m820250324rs232recieve.asm


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

.include "m8def.inc"


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

ldi r16, 0xff
out DDRC, r16

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
rjmp main

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