i have tried to make a led flasher with many programs but none seems to work.I compiled them into avrstudio. my atmega 8535 has connected some leds, the hardware is ok, but the leds(diferent types) they just light continousl.i give here one of the programs.what's wrong?
.include "m8535def.inc"
.def Temp = R16
.org 0x0000
init:
ldi temp, 0b00000001 ;
out DDRD, temp ;
main:
ldi temp, 0b00000001 ;
out portd, temp ;
rcall delay ;
ldi temp, 0x00 ;
out portd, temp ;
rcall delay ;
rjmp main ;
delay: ;
; =============================
;
; 499998 cycles: about 1/2 seconds
; -----------------------------
; delaying 499995 cycles:
ldi R29, $0F
WGLOOP0: ldi R30, $37
WGLOOP1: ldi R31, $C9
WGLOOP2: dec R31
brne WGLOOP2
dec R30
brne WGLOOP1
dec R29
brne WGLOOP0
; -----------------------------
; delaying 3 cycles:
ldi R29, $01
WGLOOP3: dec R29
brne WGLOOP3
; =============================
ret