EmbeddedRelated.com
Forums
Memfault Beyond the Launch

LPC2000 UART Baudrate Calculator

Started by nxp_marketing_usa November 1, 2006
A new UART Baudrate Calculator has been posted on the NXP Standard ICs
Website. The calculator allows you to enter in the clock rate, the
baudrate and the maximum allowed relative error and outputs the UART
settings.

The calculator works for both the standard UARTs from earlier families
and the enhanced UARTs from more recent families.

http://goo.gl/RX413

An Engineer's Guide to the LPC2100 Series

We've seen quite a few of these calculators appear over time (I have 4
saved now!).

The one problem with all of them is they insist on one particular
baudrate, rather then a range of baudrates.
Why does this matter ?
Well, in many situations, you want your port to be baudrate agile
(settable), or even use the autobaud feature of the serial port. Having
a fixed baudrate is useless in these circumstances.

Luckily, this turns out not to be an issue. You can pick a fractional
divider that suits a whole range of baudrates (it basically "converts"
your non-baudrate crystal to a baudrate friendly rate). It may not
result in the lowest % error for any given baudrate, but results in the
best compromise error rate over the range of rates you are interested in
(typically 300->115k). You then choose a desired baudrate just by
programming the normal divider as per usual, leaving the fractional
divider alone at the one value.
This is a much better solution than trying to:
a) Include the full baudrate algorithm in the embedded firmware.
b) Including lookup tables of ideal fractional dividers for every
possible baudrate.
Note that neither a nor b would work for autobauding anyway, as the
autobauder can only set the normal divider, not the fractional one.

I'd like to see a Baurdate calculator that takes these real world
considerations into account (I did mine manually). ie. You can enter in
a range of baudrates, not just one.
After all, Philips only introduced the autobaud feature into the Uarts
at the same time as they introduced the fractional dividers. Both great
features, but no documented way to use both of them at the same time.
Well they do happen to work together, so lets see a more useful
calculator.

Memfault Beyond the Launch