diff --git a/common/usart.c b/common/usart.c index e6c7373c5..b804ac8df 100644 --- a/common/usart.c +++ b/common/usart.c @@ -236,7 +236,13 @@ void usart_init(uint32_t baudrate, uint8_t parity) { // OVER = 1, -yes we are oversampling // baudrate == selected clock/8/CD --> this is ours // - pUS1->US_BRGR = 48000000 / (usart_baudrate << 3); + uint32_t fractional = 0; + if ( baudrate == 921600 ) + fractional = 4; + else if ( baudrate == 1382400 ) + fractional = 2; + uint32_t brgr = 48000000 / (usart_baudrate << 3); + pUS1->US_BRGR = (fractional << 16) | brgr; // Write the Timeguard Register pUS1->US_TTGR = 0; diff --git a/common/usart.h b/common/usart.h index 5cf549ba9..5fa0873c9 100644 --- a/common/usart.h +++ b/common/usart.h @@ -8,6 +8,9 @@ #define USART_BAUD_RATE 115200 //#define USART_BAUD_RATE 230400 //#define USART_BAUD_RATE 460800 +//#define USART_BAUD_RATE 921600 +//#define USART_BAUD_RATE 1382400 + extern uint32_t usart_baudrate; #define USART_PARITY 'N' extern uint8_t usart_parity;