ldi temp,$02 ;stack
out $3e,temp
ldi temp,$02
out $3d,temp
ldi temp,$ff
out $11,temp
ldi temp,51 ;baud 19200bps at 11.0592M fosc
out $09,temp
ldi temp,$08 ;enable rx and tx
out $0a,temp
;sei
rjmp main
main:
cbi $12,4
sbi $12,5
clr r19
ldi r22,$80
start:
ldi r21,$08
;ldi zh,high(label*2)
coloum:
ldi r20,$04
next:
; mov temp,r19
; inc r19
;rcall get_code
ldi temp,$aa
out $0c,temp
wait2:
sbis $0b,5
rjmp wait2
dec r20 ;send data to 115200bps uart
brne next
out $0c,r22
wait3:
sbis $0b,5
rjmp wait3
lsr r22
sbi $12,4
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
rcall delay
cbi $12,4
dec r21
brne coloum
rjmp main
get_code:
; ldi zl,low(label*2)
; add zl,temp
; lpm
; mov temp,r0
ldi temp,$aa
ret
delay:
ldi r24,$ff
delay1:
dec r24
brne delay1
ret