m820250323001rs232recieve.asm


;; (C) David Vajda
;; 2025-03-23
;; RS232 recieve + put it on two seven segment s

.include "m8def.inc"
.include "m820250322006siebensegmentlight.inc"

ldi r16, HIGH (RAMEND)
out SPH, r16
ldi r16, LOW (RAMEND)
out SPL, r16

rcall inithexout7seg

ldi r16, (1 << URSEL) | (1 << UCSZ1) |  (1 << UCSZ0)
out UCSRC, r16
ldi r16, HIGH (25)
out UBRRH, r16
ldi r16, LOW (25)
out UBRRL, r16
ldi r16, (1 << RXEN)
out UCSRB, r16

main:
;rcall rs232recieve
ldi r16, 0xef
rcall hexoutascii
rjmp main

rs232recieve:
sbis UCSRA, RXC
rjmp rs232recieve
in r16, UDR
ret