I tried the following code for a simple led blinking problem on ATMega32.
INCLUDE "M32DEF.INC"
SBI DDRC,5
LDI R16,0xFF
OUT PORTC,R16
AGAIN:LDI R19,255
LOOP1:LDI R18,255
LOOP2:LDI R20,5
LOOP3:NOP
NOP
NOP
NOP
NOP
DEC R20
BRNE LOOP3
DEC R18
BRNE LOOP2
DEC R19
BRNE LOOP1
COM R16
OUT PORTC,R16
RJMP AGAIN
According to the code the output is set at PortC-5. The datasheet says it works at pin 27. The simulation in Proteus works fine. However after burning the code on the chip, the actual output comes at pin 28.
The chip I am using is an Atmel ATMEGA32A PU 1527. Some of the other people who tried this had the same at pin number 29 too. Why is it happening? I am new to this field, so please help me out here.