From: hackbard Date: Sat, 6 Dec 2003 01:35:21 +0000 (+0000) Subject: some uart transmit test X-Git-Url: https://hackdaworld.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a344f7491c24124eb49d6de2374f0586e2d2799a;p=my-code%2Fatmel.git some uart transmit test --- diff --git a/beginners/test_uart.asm b/beginners/test_uart.asm index 53974a3..815f109 100644 --- a/beginners/test_uart.asm +++ b/beginners/test_uart.asm @@ -1,17 +1,39 @@ ; specify device -.DEVICE AT90S2313 +.include "../include/2313def.inc" ; baudrate einstellen ldi r16, 11 ; "38400 bps wert" in r16 -out 0x09, r16 ; write to uart baudrate register -sbi 0x0a, 3 ; enable tx at uart control register +out UBRR, r16 ; write to uart baudrate register +sbi UCR, TXEN ; enable tx at uart control register ; transmit 0x23 all the fucking time ... ldi r16, 0x23 ; load 0x23 to register -out 0x0c, r16 ; write that to uart data register port +out UDR, r16 ; write that to uart data register port LOOP: -sbis 0x0b, 5 +sbis USR, UDRE rjmp LOOP -out 0x0c, r16 +ldi r16, 0x0a +out UDR, r16 +rjmp LOOP_H + +LOOP_H: +sbis USR, UDRE +rjmp LOOP_H +ldi r16, 0x68 +out UDR, r16 +rjmp LOOP_D + +LOOP_D: +sbis USR, UDRE +rjmp LOOP_D +ldi r16, 0x64 +out UDR, r16 +rjmp LOOP_W + +LOOP_W: +sbis USR, UDRE +rjmp LOOP_W +ldi r16, 0x77 +out UDR, r16 rjmp LOOP