Hello!
I'am trying to make a LED to turn on and turn off with this code and Arduino IDE
When I upload it to the Arduino, the board selected is "Arduino Genuino/ Uno" and the assembly code is in the ".S" file, can you help me to solve why this isn't working?
.global setup
.global loop
setup:
sbi 0x18,5 ; Se iniciliza el pin13
ret
loop: ldi r20,255
rcall delayMsecs ; Se llama al delay
sbi 0x18,5 ; Se enciende el LED
ldi r20,255
rcall delayMsecs ; Se llama al delay
cbi 0x18,5 ; Se apaga el LED
rjmp loop ; Se vuelve a llamar a loop para hacer el ciclo infinito
delayMsecs:
; Se generan ciclos para hacer el delay
ldi 31, 10000>>8
ldi 30, 10000&255
delayLp:
sbiw r30, 1
brne delayLp
subi r20, 1
brne delayMsecs
ret