cancel
Showing results for 
Search instead for 
Did you mean: 

UART Misses Characters

meerd1
Associate II
Posted on December 30, 2013 at 11:32

Hello!

I have a STM32L151CB and I need to use the UART interface. At first it worked perfectly, but after I changed the system clock from HSI (16 MHz) to MSI (2 MHz) I only receive some characters.

E.g. when I send ''Hello'' I receive ''Hlo''.

The UART us configured as follows:

Baud rate: 115200

Word length: 8 bit

Stop bits: 1

Parity: no

Flow control: no

It works with a baud rate of 9600, but I would prefer 115200 baud.

Did I miss something or is it not possible to use a fast UART with the MSI clock?

Regards,

Daniel
11 REPLIES 11
lowpowermcu
Associate II
Posted on December 30, 2013 at 16:29

Hi Daniel,

Can you share your code?

Can you change the baudrate 115000 to 9600 and check if you have the same behavior?

Posted on December 30, 2013 at 16:52

Well the % error of the bit rate is about 3% at 2 MHz, and 0.08% at 16 MHz

You'd want to examine how you're servicing the USART, how efficiently/effectively that is being done, and if you see any overrun/underrun errors.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..