I'm having a little trouble getting this loop to work. I've been reading the documentation over at avrbeginners.net and constructed this:
#define DDRD 0x11 #define PD0 0x12 .global main main: ldi r16, 0x01 ; enable output on port D out DDRD, r16 in r24, PD0 ; toggle LED ldi r25, 0x01 eor r24, r25 out PD0, r24 ldi r30, 0 ; clear counting register delay: nop nop nop nop nop inc r30 cpi r30, 0xFF brne delay ; repeat until counter is 255 rjmp main
I'm not exactly sure where I went wrong here. I'm trying to loop through delay:, then return to main and xor the value of PD0. Can anyone point me in the right direction?