X-Git-Url: http://cloudbase.mooo.com/gitweb/avrcpm.git/blobdiff_plain/6efd62917aa6ec2eac5fc633c21c28c4830c2087..e8384f88b1a073f47591b9ca13b73da12a7c59a8:/avr/sw-uart.asm diff --git a/avr/sw-uart.asm b/avr/sw-uart.asm index df25d09..3216293 100644 --- a/avr/sw-uart.asm +++ b/avr/sw-uart.asm @@ -21,7 +21,12 @@ ; $Id$ ; +#ifdef __ATmega8__ + #error "ATmega8 is not supported (yet)! Please update this driver, or buy an ATmega88." +#endif + #define SSER_BIT_TC (F_CPU+BAUD/2) / BAUD +#define SSER_CHAR_TC (10 * 1000 / BAUD) + 2 #define RXBUFMASK RXBUFSIZE-1 #define TXBUFMASK TXBUFSIZE-1 @@ -32,10 +37,12 @@ srx_state: .byte 1 srx_char_to: .byte 1 +srx_char_time: + .byte 1 srx_dr: .byte 1 -;srx_lastedge: -; .byte 2 +srx_lastedge: + .byte 2 stx_bitcount: .byte 1 stx_dr: @@ -70,14 +77,23 @@ uart_init: ; - Soft UART RX (ICP1/ICR1). ; - 1ms System timer is already configured at this point. + + cbi P_TXD-1,TXD ;TXD pin as input ldi temp,(1<