Use alternate UART TxD/RxD pins

This commit is contained in:
Allen Hill
2023-08-20 20:41:25 -04:00
parent 48b20a9c5c
commit c4f67378ae
+2
View File
@@ -34,6 +34,8 @@ byte readkey;
void RS232_Init(void) {
RS232_RxCharBegin = RS232_RxCharEnd = 0;
PORTMUX.CTRLB = PORTMUX_USART0_ALTERNATE_gc; // Use PA1/PA2 for TxD/RxD
USART0.CTRLA = USART_RXCIE_bm; // Enable receive interrupts
USART0.CTRLB = USART_RXEN_bm | USART_TXEN_bm |
USART_RXMODE_NORMAL_gc; // Enable Rx/Tx and set receive mode