.def temp = r16 ;temporary data
.org $0000
ldi temp,low(RAMEND)
out SPL,temp
ldi temp,high(RAMEND)
out SPH,temp ;init Stack Pointer
ldi temp,255
out DDRA,temp
ldi temp,0
out DDRB,temp
rjmp start ;reset handler
.org URXCaddr ;definition in the
rjmp UART_RX_interrupt ;8515 include file
;receive complete interrupt
UART_RX_interrupt:
in temp ,UDR
out PORTA,temp
rcall transmit
reti
;initialize UART
initialize:
out UBRRL, temp ;init baudrate
;enable receiver, transmitter and TXCint
ldi temp, (1<
sei ;global interrupt enable
ret
;transmit a byte
transmit:
sbis UCSRA,UDRE ;ready to send?
rjmp transmit
in temp,PINB
out UDR, temp
ret
start:
ldi temp, 25 ;19.200bps@8MHz
rcall initialize
forever:
rjmp forever ;eternal loop