2017-12-30 02: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 #error2017-12-30 02: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?
2017-12-30 02:41 PM
The BRR is an integer register, at OVER16 brr = apbclk / baud;
actualbaud = apbclk / brr;
error = 100 - ((actualbaud / baud) * 100)
2017-12-31 04:35 AM
Thanks for reply.
Yes - exactly - how to calculate actual baud rate?
i.e. 460.8KBps(desired) = 461.54KBps(actual) - why?
2017-12-31 04: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?
2017-12-31 05:53 AM
You are using integers so fractional precision is lost. You can use rounding, or start with source clocks which are exact multiples.