STM32 USART Timing problem
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-03-11 5:07 AM
Posted on March 11, 2013 at 13:07
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 #usart-timing-problem
Labels:
- Labels:
-
UART-USART
This discussion is locked. Please start a new topic to ask your question.
3 REPLIES 3
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-03-11 5:20 AM
Posted on March 11, 2013 at 13:20
1/3 sounds close to 8/25
Make sure HSE_VALUE for your project matches the HSE placed on the board, and the PLL settings. Honestly not sure why you have APB at 500KHz, but whatever.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-03-11 5:57 AM
Posted on March 11, 2013 at 13:57
The PC sees for some reason an inversion of what is transmitted.
Are you sure you use a proper level shifter (MAX3232 or similar)? JWOptions
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2013-03-13 4:42 AM
Posted on March 13, 2013 at 12:42
Hello Ian;
that's possibly the reason ;) I have ordered a level shifter and then i try again.