EmbeddedRelated.com
Forums

UART Baudrate Tool uploaded

Started by Joel Winarske October 20, 2005
I just posted a simple Win32 cmd line tool to calculate the optimum register
settings for a LPC214x UART peripheral.
I am not aware if all the LPC2k UART peripherals are the same or not. If so
great. I was working against the LPC2148 user manual.

It seems the equation in the user manual to calculate the baud rate is
incorrect.

It should be:
Baudrate =
(PCLK/(16*(256*PRE_SCALE_MSB+PRE_SCALE_LSB)))*(MulVl/(MulVal+DivAddVal))

opposed to:
Baudrate =
(PCLK/(16*(16*PRE_SCALE_MSB+PRE_SCALE_LSB)))*(MulVl/(MulVal+DivAddVal))

I replicated the user manual example baud table using my software with
modified equation.

Minor typo in the user manual: The percent error value for the optimized
56000 baud is incorrect, it should read 0.1600 opposed to 0.0160.

I hope you find it useful.

If can be found in: http://groups.yahoo.com/group/lpc2000/files/Tools/ Regards,
Joel Winarske
Systems Architect
Independent Electronics, Inc.
V 707.320.4271
M 408.203.2770
F 408.516.5978
www.indyelectronics.com


An Engineer's Guide to the LPC2100 Series

--- In lpc2000@lpc2..., "Joel Winarske" <joelw@i...> wrote:
>
> I just posted a simple Win32 cmd line tool to calculate the
optimum register
> settings for a LPC214x UART peripheral.
> I am not aware if all the LPC2k UART peripherals are the same or
not. If so
> great. I was working against the LPC2148 user manual.
>
> It seems the equation in the user manual to calculate the baud
rate is
> incorrect.
>
> It should be:
> Baudrate =
> (PCLK/(16*(256*PRE_SCALE_MSB+PRE_SCALE_LSB)))*(MulVl/
(MulVal+DivAddVal))
>
> opposed to:
> Baudrate =
> (PCLK/(16*(16*PRE_SCALE_MSB+PRE_SCALE_LSB)))*(MulVl/
(MulVal+DivAddVal))
>
> I replicated the user manual example baud table using my software
with
> modified equation.
>
> Minor typo in the user manual: The percent error value for the
optimized
> 56000 baud is incorrect, it should read 0.1600 opposed to 0.0160.
>
> I hope you find it useful.
>
> If can be found in:
http://groups.yahoo.com/group/lpc2000/files/Tools/
>
>
> Regards,
> Joel Winarske
> Systems Architect
> Independent Electronics, Inc.
> V 707.320.4271
> M 408.203.2770
> F 408.516.5978
> www.indyelectronics.com
>
Hi,
There is already similar tool in file section in file LPCUST.zip.
Is your utility different in calculations ?
Radim.


I changed the name of this to "LPC2000 UART Fractional Divider Calculator".

http://groups.yahoo.com/group/lpc2000/files/Tools/lpc2fdcalc.exe

As far as I have determined, only the LPC214x series UART implements a
Fractional Divider. This is a very nice feature, more parts should
implemented this. RS-485 hardware support (tx enable) would be a plus too. -Joel


> Hi,
> There is already similar tool in file section in file LPCUST.zip.
> Is your utility different in calculations ?

Yes, mine is solely for calculating the optimal values for a UART that
implements a fractional divider. Which currently addresses the LPC214x
series.

-Joel


Radim,

the major difference is that you don't need to use a 14.756 MHz any
more to get to a 115200 (or for that matter any standard baudrate).
The fractional baudrate generator is new to the LPC214x and for a
reason. To run the USB, you need a value for the clock like 12 MHz or
16 MHz. This does not compute very well with 115200 serial baudrate if
you don't have a fractional baudrate generator.
I hope there will be such a BR-generator also on the CAN chips some
time soon as they face the same problem.

Bob

--- In lpc2000@lpc2..., "radim100" <radim100@y...> wrote:
>
> --- In lpc2000@lpc2..., "Joel Winarske" <joelw@i...> wrote:
> >
> > I just posted a simple Win32 cmd line tool to calculate the
> optimum register
> > settings for a LPC214x UART peripheral.
> > I am not aware if all the LPC2k UART peripherals are the same or
> not. If so
> > great. I was working against the LPC2148 user manual.
> >
> > It seems the equation in the user manual to calculate the baud
> rate is
> > incorrect.
> >
> > It should be:
> > Baudrate =
> > (PCLK/(16*(256*PRE_SCALE_MSB+PRE_SCALE_LSB)))*(MulVl/
> (MulVal+DivAddVal))
> >
> > opposed to:
> > Baudrate =
> > (PCLK/(16*(16*PRE_SCALE_MSB+PRE_SCALE_LSB)))*(MulVl/
> (MulVal+DivAddVal))
> >
> > I replicated the user manual example baud table using my software
> with
> > modified equation.
> >
> > Minor typo in the user manual: The percent error value for the
> optimized
> > 56000 baud is incorrect, it should read 0.1600 opposed to 0.0160.
> >
> > I hope you find it useful.
> >
> > If can be found in:
> http://groups.yahoo.com/group/lpc2000/files/Tools/
> >
> >
> > Regards,
> > Joel Winarske
> > Systems Architect
> > Independent Electronics, Inc.
> > V 707.320.4271
> > M 408.203.2770
> > F 408.516.5978
> > www.indyelectronics.com
> >
> Hi,
> There is already similar tool in file section in file LPCUST.zip.
> Is your utility different in calculations ?
> Radim.
>