0

I am trying to program my Arduino UNO ATMega 328p in assembler to implement a flashing pattern with two LEDs. When one LED is off, the other must be on. I have made a program but it is showing errors and I don't know how to fix it. I have done it Atmel Studio 7. Please help if you can.

Here is my program:

main:

sbi 0x04, 5
sbi 0x04, 4

start:

sbi 0x05, 5
ldi r16,1000
rcall delay
cbi 0x05, 5

sbi 0x05, 4
ldi r16,1000
rcall delay
cbi 0x05, 4

rjmp start

delay:

dec r8
brne delay
dec r9
brne delay
dec r16
brne delay
ret
  • 2
    Please show the errors you received. – JRobert Aug 12 at 16:54
  • When I run this I get 2 errors: Operand(s) out of range in 'ldi r16,0x3e8' Operand(s) out of range in 'ldi r16,0x3e8' – user58745 Aug 12 at 17:29
  • I think I found the problem now, thanks anyways :) – user58745 Aug 12 at 17:29
  • @user58745 Then please write an answer to your question, so that others can learn from this. – chrisl Aug 12 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.