\r
/* Set up the synchronous USART for XMEGA communications - \r
8 data bits, even parity, 2 stop bits */\r
- UBRR1 = 10;\r
+ UBRR1 = (F_CPU / 1000000UL);\r
UCSR1B = (1 << TXEN1);\r
UCSR1C = (1 << UMSEL10) | (1 << UPM11) | (1 << USBS1) | (1 << UCSZ11) | (1 << UCSZ10) | (1 << UCPOL1);\r
\r
PORTD |= (1 << 3);\r
DDRD |= (1 << 3);\r
\r
- UCSR1B &= ~(1 << RXEN1);\r
UCSR1B |= (1 << TXEN1);\r
+ UCSR1B &= ~(1 << RXEN1);\r
\r
IsSending = true;\r
}\r
\r
/* Wait until there is space in the hardware Tx buffer before writing */\r
while (!(UCSR1A & (1 << UDRE1)));\r
- UDR1 = Byte;\r
+ UCSR1A |= (1 << TXC1);\r
+ UDR1 = Byte;\r
#else\r
/* Switch to Tx mode if currently in Rx mode */\r
if (!(IsSending))\r