Skip to main content
John Doe1
Associate III
December 30, 2017
Question

how to calculate usart ''Error calculation'' - desired baud rate != actual baud rate

  • December 30, 2017
  • 5 replies
  • 2871 views
Posted on December 30, 2017 at 23:17

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
This topic has been closed for replies.

5 replies

Andrew Neil
Super User
December 30, 2017
Posted on December 30, 2017 at 23:35

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 that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
John Doe1
John Doe1Author
Associate III
December 31, 2017
Posted on December 31, 2017 at 12:35

Thanks for reply.

Yes - exactly - how to calculate actual baud rate?

i.e. 460.8KBps(desired) = 461.54KBps(actual) - why?

Tesla DeLorean
Guru
December 30, 2017
Posted on December 30, 2017 at 23:41

The BRR is an integer register, at OVER16  brr = apbclk / baud;

actualbaud = apbclk / brr;

error = 100 - ((actualbaud / baud) * 100)

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
John Doe1
John Doe1Author
Associate III
December 31, 2017
Posted on December 31, 2017 at 12:38

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?

Tesla DeLorean
Guru
December 31, 2017
Posted on December 31, 2017 at 13:53

You are using integers so fractional precision is lost. You can use rounding, or start with source clocks which are exact multiples.

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..