summaryrefslogtreecommitdiff
path: root/hardware/cmx589a_teensy_test/uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'hardware/cmx589a_teensy_test/uart.c')
-rw-r--r--hardware/cmx589a_teensy_test/uart.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/hardware/cmx589a_teensy_test/uart.c b/hardware/cmx589a_teensy_test/uart.c
index 2fdcc43..94afe7e 100644
--- a/hardware/cmx589a_teensy_test/uart.c
+++ b/hardware/cmx589a_teensy_test/uart.c
@@ -48,9 +48,16 @@ void uart_init(uint32_t baud)
UBRR1 = (F_CPU / 4 / baud - 1) / 2;
UCSR1A = (1<<U2X1);
UCSR1B = (1<<RXEN1) | (1<<TXEN1) | (1<<RXCIE1);
- UCSR1C = (1<<UCSZ11) | (1<<UCSZ10);
+ //UCSR1C = (1<<UCSZ11) | (1<<UCSZ10);
tx_buffer_head = tx_buffer_tail = 0;
rx_buffer_head = rx_buffer_tail = 0;
+
+ UCSR1C = 0;
+ UCSR1C |= (1 << UMSEL10) | (1 << UCSZ10) | (1 << UCSZ11);
+ //use external clk by settting PD5 aka XCK1 to Input
+ DDRD |= 1<<5;
+
+
sei();
}