AnsweredAssumed Answered

STM32 USART Timing problem

Question asked by rupprath.marc on Mar 11, 2013
Latest reply on Mar 13, 2013 by rupprath.marc
Hello;
i have a small USART Test application.
 It should send, controlled by an timer, constant "A" characters

By receiving a character from the terminal Program of the PC an interupt is fired.

The terminal programm reveices "other charcters, different from "A", and variing.
When i send characters from the terminal programm, the interrupt routine is fired but i got the wrong data:

Examples:

   "A" = 65 send from terminal application und "_" = 95 reiceved by µC
   "B" = 66 send and "/" = 47 received.

The error can be reproduced, i always receive the same "wrong" values for specific characters send.

I have heard that the reason is a wrong setting of the USART BRR Register 
I have checked the following:

Actually my USART 3 Clock is running at 500000Hz (because i am testing timers too) 

If i am right: BRR Register = USART Clockspeed/ Baudrate
In my case: BRR Register = 500000 / 2400 = 208.3333333
Actual  BRR Register contains: 208

The difference between the calculated value and the actual register contents is 1/3 .
Is this the reason for my communication problem , and how to handle ?


Thanks in advance

Marc

Outcomes