Topic : STM32 Primer USART Problem

Forum : ARM

Original Post
Post Information Post
September 26, 2008 - 5:53pm
Guest

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.
Is there anyone having this problem?
Thank you

Replies
Post Information Post
+1
0
-1
October 1, 2008 - 12:08pm
Guest

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

+1
0
-1
October 1, 2008 - 12:48pm
Guest

OK, now it works.
Thank you