View Full Version : UART speed on Tini2138?
JonHylands
12-04-06, 03:02 PM
I have a Tini2138, and I was wondering if it is capable of doing exactly 1 Mbps over either of the hardware UARTS?
Thanks,
Jon
Hi Jon,
The LPC213x uses manual describes some on this :
Support page with users manual (http://www.nxp.com/pip/LPC2132FBD64.html#support)
In Chapter 9 (page 87) of the LPC213x User manual it says that the peripheral clock PCLK is divided by the UART0 Divisor Latch Registor to produce a baud rate clock, which must be 16 times the requested baud rate. An equation is given of :
UART0(baudrate) = PCLK / 16 x ( 16 x U0DLM +U0DLO)
which has a slight mistake in having one too many 16s. In their table below that is an example that the divsor is only 16 times the upper and lower byte contents of the 2 registers, with a minimum divisor of 1.
Backing up a little, PCLK is determined by the VPB divider and the main processor clock CCLK. The Tini2131 and Tini2138 devices use a 10 MHz crystal, and therefore operate at 60 MHz CCLK. The VPB divider at bootup defaults to make PCLK one quarter of CCLK. To change this, a new value must be loaded into the VPBDIV register, in the 2 least bits (Chapter 3 page 38-39).
So initially, on boot-up, PCLK should be at 15 MHz, which means that the max baud rate would be 937500 (PCLK / (16 x 1)). In other manipulations of VPBDIV, the baudrate remains at this 6.25 % error off of 1 Mbps. The rate for UART1 is determined in the same manner as UART0.
If exactly 1 Mbps were required, then a change of crystal would be needed.
The MAX3221 transceiver used with UART0 has a max data rate of 235 kbps typically, 120 kpbs minimum. Pins 38 and 39 used for UART1 are not used on the Tini2138, but are available on the Pluga2138.
nmitech
12-05-06, 12:39 PM
The correct equation is,
UART0(baudrate) = PCLK / 16 x ( 256 x U0DLM + U0DLL)
Where the result of the numbers in red quotation is equal to the 16-bit decimal value of U0DLM & U0DLL registers combined
Here is the updated LPC2131-8 user manual. Please see chapter 9 for detail.
http://www.standardics.nxp.com/support/documents/microcontrollers/pdf/user.manual.lpc2131.lpc2132.lpc2134.lpc2136.lpc2138.pdf
Pacetech
12-05-06, 06:56 PM
The MAX3227 from Maxim and TI appears to be a drop in replacement for the MAX3221, and its guaranteed to 1MBPS.
nmitech
12-06-06, 10:27 AM
Pacetech is right, MAX3227 from Maxim and TI can be a drop in replacement for the MAX3221. Eventhough pin 1 on both chips have different I/O functions but it's safe for drop in replacement with or without the pulldown resistor on the existing circuit. For your option, you can make a special order request with the MAX3227 installs as we have done this for some custom built PlugaPods in the past.
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.