EmbeddedRelated.com
Forums

Calculating optimal baud rate

Started by Karim Emara March 8, 2010
Hi,

I am working with LPC2148 and trying to figure out how optimal baud rate is
computed for UART0. I tried to make an excel file to tryout all combinations
and get the optimal values of (MulVal, DIVADDVAL and DL). However, optimal
values are not the same shown in the user manual. I searched for similar
calculators and found this calculator on nxp
http://www.standardics.nxp.com/support/documents/microcontrollers/xls/lpc2000.uart.baudrate.calculator.xls

It works in the same manner/equations i used in my calc but the only
difference is the values range of MulVal and DivAddVal. It uses 0
<= DivAddVal <= 14 while it uses DivAddVal < MulVal <= 15 !!! In manual, it
asserts that both ranges are from 0 - 15 (except that MULval is nonzero)

After using such ranges in my calc, results are exactly the same as shown in
the user manual. Does anyone know why these ranges are selected?

Thanks in advance

Best Regards,
Karim A. Emara

An Engineer's Guide to the LPC2100 Series

Hi,

I discovered that I judged the issue in hurry. The nxp calculator is wrong
(does not match with data shown in the lpc2148 user manual)
I tried more baud rates and found that testing all combinations is a must

However, I discovered another exception as specified here
http://www.embeddedrelated.com/groups/lpc2000/show/22924.php by Karl Olsen.
Manuals of newer chips like 236x say that DL should be >= 2 as it makes
problems in higher baud rates

I modified my calcand
it works very well now. I upload it in files section

Best Regards,
Karim A. Emara
On Mon, Mar 8, 2010 at 5:17 PM, Karim Emara wrote:

> Hi,
>
> I am working with LPC2148 and trying to figure out how optimal baud rate is
> computed for UART0. I tried to make an excel file to tryout all combinations
> and get the optimal values of (MulVal, DIVADDVAL and DL). However, optimal
> values are not the same shown in the user manual. I searched for similar
> calculators and found this calculator on nxp
>
> http://www.standardics.nxp.com/support/documents/microcontrollers/xls/lpc2000.uart.baudrate.calculator.xls
>
> It works in the same manner/equations i used in my calc but the only
> difference is the values range of MulVal and DivAddVal. It uses 0
> <= DivAddVal <= 14 while it uses DivAddVal < MulVal <= 15 !!! In manual, it
> asserts that both ranges are from 0 - 15 (except that MULval is nonzero)
>
> After using such ranges in my calc, results are exactly the same as shown
> in the user manual. Does anyone know why these ranges are selected?
>
> Thanks in advance
>
> Best Regards,
> Karim A. Emara
>