Setup UART Baudrate 9600, but output is 4800?? (STM32F103C8Tx, blue pill)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-13 6:08 AM
Hello, I'm a newbie with STM32.
I transmit data over the UART interface and I have configured 9600 Baudrate, but I can only receive the correct data on my PC terminal if I setup to 4800.. So why the Baudrate is effectively 2 times lower? I'm using the blue pill board with the STM32F103C8Tx, and clock configuration Sysclk,Hcclk is 72Mhz, setup with STM32CubeMx. (no warnings at build)
sorry my poor english.
thank you very much
- Labels:
-
STM32CubeMX
-
STM32F1 Series
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-13 6:12 AM
The define for HSE_VALUE likely disagrees with crystal in use. Check clocks and PLL settings
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-13 6:27 AM
thanks, see attached my clock configuration. unfortunately I have no idea which parameters I must change for that. The external crystal is a 8.000 MHz.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-13 6:52 AM
update, if I change PLL Source Mux to HSI it works... very special?!.
what do to use the external clock correctly?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-13 8:22 AM
Make sure a) the hardware actually clocks properly, get a scope and measure, output internal clocks via PA8 (MCO) pin, and b) that the setting of HSE_VALUE is coherent, ie HW and SW working from the same set of facts, so the computations will work correctly for the baud rate divider settings.
Up vote any posts that you find helpful, it shows what's working..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-13 9:26 AM
You must define HSE_VALUE at project level, of course mathcing the actual crystal value.
​
Its not once or twice that I have done the mistake of not doing so, ​and then chased ghost's only because cube failed to generate the correct clock value in code.(for reason or another it does like to set the HSE_VALUE = 25mhz, no matter what i put in the text box)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2019-09-13 12:42 PM
Also, when using crystal, make sure that HSE bypass mode is not enabled.
