X-Git-Url: https://hackdaworld.org/gitweb/?p=my-code%2Fatmel.git;a=blobdiff_plain;f=hdw-tank%2Fuart.asm;h=bb189daa82b482ff214037e62d72061cc604e208;hp=1ca82e08995e55fa26e0c3c14fae516952d60a8d;hb=ebc6337dea06a5abd94de3794352accb573e22ec;hpb=bc07798b093617e4b907b3fdb2155dc098b03e0b diff --git a/hdw-tank/uart.asm b/hdw-tank/uart.asm index 1ca82e0..bb189da 100644 --- a/hdw-tank/uart.asm +++ b/hdw-tank/uart.asm @@ -1,36 +1,60 @@ ; uart functions +; default uart settings +; infdef UART_BR_H +.equ UART_BR_H = 0 +; infdef UART_BR_L +.equ UART_BR_L = 25 + UART_INIT: ; baudrate - ldi tmp, - out UBRRH,tmp - ldi tmp, - out UBRRL,tmp + ldi uart_rxtx,UART_BR_H + sts UBRR0H,uart_rxtx + ldi uart_rxtx,UART_BR_L + out UBRR0L,uart_rxtx ; enable - ldi tmp,(1< 8n1 + ldi uart_rxtx,(1<