how to calculate usart ''Error calculation'' - desired baud rate != actual baud rate
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-30 2:17 PM
Hello all,
I have no idea how to calculate usart '% error calculation' for stm32f429. There is difference between actual baud rate and desired baud rate. Why actual baud rate != desired baud rate?
I try to calculate usart % of error for 90mhz. The last calculation in documentation is for 84mhz (see attach).
thanks in advance
#percentage #usart #calculate #stm32f4-uart-brr-sampling-8 #error- Labels:
-
UART-USART
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-30 2:35 PM
Calculating the error is easy - it's just the difference between your actual baud rate, and the desired baud rate.
I guess you really mean how to calculate the actual baud rate?
A complex system designed from scratch never works and cannot be patched up to make it work.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-30 2:41 PM
The BRR is an integer register, at OVER16 brr = apbclk / baud;
actualbaud = apbclk / brr;
error = 100 - ((actualbaud / baud) * 100)
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
‎2017-12-31 4:35 AM
Thanks for reply.
Yes - exactly - how to calculate actual baud rate?
i.e. 460.8KBps(desired) = 461.54KBps(actual) - why?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-31 4:38 AM
Right . That's just simple math.
I realized that actual baud rate is different than desired baud rate. No idea why desired is different than actual.
Any hints how to calculate actual baud rate and why it's different than desired?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2017-12-31 5:53 AM
You are using integers so fractional precision is lost. You can use rounding, or start with source clocks which are exact multiples.
Up vote any posts that you find helpful, it shows what's working..
