EmbeddedRelated.com
Forums

LPC2129 and U0FDR serial register

Started by tomi March 23, 2010
I have LPC2129 board:
- 12MHZ crystal
- PLL x5 enabled
- VPDIV = 2

CCLK = 60MHz, PCLK0MHz

I'm trying to set serial baudrate 115200.
this setting is working correctly, but I have 1,73% error
U0LCR = 0x83; // Enable access to divisor latchs
U0DLL = 16;
U0DLM = 0;
U0LCR = 0x03; // 8n1
but with this I see trash
U0LCR = 0x83; // Enable access to divisor latchs
U0DLL = 12;
U0DLM = 0;
U0FDR = 0x000000E5;
U0LCR = 0x03; // 8n1

This code is working correctly on LPC2148, but on LPC2129 I can't set U0FDR
correctly
What is wrong ?

This is calculation from lpc2000.uart.baudrate.calculator.xls
UART clock [Hz] 30000000
Requested UART baudrate 115200
Maximum allowed relative error [%] 2,5

Best available fit for standard UART
UART baudrate 117187,50
Relative error 1,73%
UDL [dec] 16
UDLM [dec] 0
UDLL [dec] 16

Best available fit for enhanced UART
UART baudrate 115131,58
Relative error -0,06%
UDL [dec] 12
UDLM [dec] 0
UDLL [dec] 12
DivAddVal [dec] 5
MulVal [dec] 14

An Engineer's Guide to the LPC2100 Series

Hello,

> This code is working correctly on LPC2148, but on LPC2129
> I can't set U0FDR
> correctly
> What is wrong ?

old LPC2129 does not have the fractional baudrate generator.

Have a look at table 131 (page 129) on the following user manual:

http://ics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc2109.lpc2114.lpc2119.lpc2124.lpc2129.lpc2194.lpc2210.lpc2212.lpc2214.lpc2220.lpc2290.lpc2292.lpc2294.pdf

Do you use an old LPC2129 part ?

Best regards,

Martin

2010/3/23 capiman26061973

> Hello,
> > This code is working correctly on LPC2148, but on LPC2129
> > I can't set U0FDR
> > correctly
> > What is wrong ?
>
> old LPC2129 does not have the fractional baudrate generator.
>
> Have a look at table 131 (page 129) on the following user manual:
> http://ics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc2109.lpc2114.lpc2119.lpc2124.lpc2129.lpc2194.lpc2210.lpc2212.lpc2214.lpc2220.lpc2290.lpc2292.lpc2294.pdf
>
> Do you use an old LPC2129 part ?

No. I have LPC2129FB064/01 with bootloader 1.68. In this manual I see:
"Therefore, the registers controlling enhanced features are available only
for /01"

Best regards