Write an assembly program that toggles a LED connected to pin4 of
PORTB with a custom delay time.
; Main Program
CPL PB4 // compliments value at pin 4 of PORT B
ACALL Wait // calls wait function
SJMP Start
Wait : MOV R4 , #05H // puts value 05H in R4
Wait1 : MOV R3 , #00H // puts value 00H in R3
Wait2: MOV R2 , #00H //puts value 00H in R2
Wait3 : DJNZ R2,Wait3
DNJZ R3,Wait2
DNJZ R4,Wait1
RET
Hope this helps. If you have any queries or suggestions regarding the answers please leave them in the comments section so I can update and improve the answer. Thank you.
Get Answers For Free
Most questions answered within 1 hours.