2024-06-04 02:19 AM
Hi everybody,
I use UART6 of STM32F437 and want to change baud rate between baud rate 115200, 460800 and 921600 in runtime
I've followed some answers from a post here:
USART6 -> CR1 &= ~(USART_CR1_UE);
USART6 -> BRR = NEWVALUE;
USART6 -> CR1 |= USART_CR1_UE;
But still can't seem to get the baud rate to change. Has anyone change the baud rate of the UART successful?
/****************************************************/
Thanks and brgs
2024-06-04 02:46 AM
Have you checked the Datasheet and/or Reference Manual ?
https://www.st.com/en/microcontrollers-microprocessors/stm32f437ai.html#documentation
(Product Page doesn't seem to be working for me at the moment)
2024-06-04 03:28 AM
Rather than just UE, does it help if you (also) clear TE and/or RE for the change?
2024-06-04 09:22 PM
Thanks for your reply
Can you talk clearly? Do you have sample code to change baud rate uart runtime
2024-06-04 11:17 PM
Sorry, no. It was just a suggestion - something for you to try.
2024-06-04 11:19 PM
As @Andrew Neil said, try to disable TE & RE in CR1 before changing baud rate.
From RM0090:
30.6.3 Baud rate register (USART_BRR)
Note: The baud counters stop counting if the TE or RE bits are disabled respectively.