Forum : ARM
Original Post
Post Information | Post |
---|---|
September 26, 2008 - 5:53pm
|
We are trying to use USART2 in the STM32 Primer. The RCC is programmed for HSE @12MHz (HSE_Value = 12000000). When we program the USART2 baudrate for 9600 bps, the BRR register value is computed based on the internal 8MHz clock and not based on the true 12MHz value. The micro controller runs really at 12MHz but the real value of data transmission baudrate is greater than 9600. |
Hi
I have made some trials and I would suggest that you use the ST library not as precomiled but by adding the source files you need in your project.
This way when you will change the HSE_value and build the project the functions that take this value will be rebuilt and will take the good value.
For instance in this case:
1. The HSE_value must be changed in your stm32f10x_conf.h
2. The file stm32f10x_rcc.c must be added in your project so it will get the good value
Matloub
OK, now it works.
Thank you