Single-chip 16/32-bit microcontrollers; 32/64/128/256/512 kB
ISP/IAP flash with 10-bit ADC and DAC
Rev. 04 — 16 October 2007Product data sheet
1.General description
The LPC2131/32/34/36/38 microcontrollers are based on a 16/32-bit ARM7TDMI-S CPU
with real-time emulation and embedded trace support, that combine the microcontroller
with 32 kB, 64 kB, 128 kB, 256 kB and 512 kB of embedded high-speed flash memory. A
128-bit wide memory interface and a unique accelerator architecture enable 32-bit code
execution at maximum clock rate. For critical code size applications, the alternative 16-bit
Thumb mode reduces code by more than 30 % with minimal performance penalty.
Due to their tiny size and low power consumption, these microcontrollers are ideal for
applications where miniaturization is a key requirement, such as access control and
point-of-sale. With a wide range of serial communications interfaces and on-chip SRAM
options of 8 kB, 16 kB, and 32 kB, they are very well suited for communication gateways
and protocol converters, soft modems, voice recognition and low-end imaging, providing
both large buffer size and high processing power. Various 32-bit timers, single or dual
10-bit 8-channel ADC(s), 10-bit DAC, PWM channels and 47 GPIO lines with up to nine
edge or level sensitive external interrupt pins make these microcontrollers particularly
suitable for industrial control and medical systems.
2.Features
2.1 Enhancements brought by LPC213x/01 devices
2.2 Key features common for LPC213x and LPC213x/01
n Fast GPIO ports enable port pin toggling up to 3.5 times faster than the original
LPC213x. They also allow for a port pin to be read at any time regardless of its
function.
n Dedicated result registers for ADC(s) reduce interrupt overhead.
n UART0/1 include fractional baud rate generator, auto-bauding capabilities and
handshake flow-control fully implemented in hardware.
n Additional BOD control enables further reduction of power consumption.
n 16/32-bit ARM7TDMI-S microcontroller in a tiny LQFP64 or HVQFN package.
n 8/16/32 kB of on-chip static RAM and 32/64/128/256/512 kB of on-chip flash program
n In-System Programming/In-ApplicationProgramming (ISP/IAP) via on-chip bootloader
software. Single flash sector or full chip erase in 400 ms and programming of 256 B in
1 ms.
n EmbeddedICE RT and Embedded Trace interfaces offer real-time debugging with the
on-chip RealMonitor software and high-speed tracing of instruction execution.
NXP Semiconductors
n One (LPC2131/32) or two (LPC2134/36/38) 8-channel 10-bit ADCs provide a total of
n Single 10-bit DAC provides variable analog output (LPC2132/34/36/38).
n Two 32-bit timers/external event counters (with four capture and four compare
n Low power Real-time clock with independent power and dedicated 32 kHz clock input.
n Multiple serial interfaces including two UARTs (16C550), two Fast I2C-bus (400 kbit/s),
n Vectored interrupt controller with configurable priorities and vector addresses.
n Up to forty-seven 5 V tolerant general purpose I/O pins in tiny LQFP64 or HVQFN
n Up to nine edge or level sensitive external interrupt pins available.
n 60 MHz maximum CPU clock available from programmable on-chip PLL with settling
n On-chip integrated oscillator operates with external crystal in range of 1 MHz to
n Power saving modes include Idle and Power-down.
n Individual enable/disable of peripheral functions as well as peripheral clock scaling
n Processor wake-up from Power-down mode via external interrupt or BOD.
n Single power supply chip with POR and BOD circuits:
LPC2131/32/34/36/38
Single-chip 16/32-bit microcontrollers
up to 16 analog inputs, with conversion times as low as 2.44 µs per channel.
channels each), PWM unit (six outputs) and watchdog.
SPI and SSP with buffering and variable data length capabilities.
package.
time of 100 µs.
30 MHz and with external oscillator up to 50 MHz.
down for additional power optimization.
u CPU operating voltage range of 3.0 V to 3.6 V (3.3 V ± 10 %) with 5 V tolerant I/O
LPC2138FHN64HVQFN64 plastic thermal enhanced very thin quad flat
LPC2138FHN64/01 HVQFN64 plastic thermal enhanced very thin quad flat
…continued
body 10 × 10 × 1.4 mm
body 10 × 10 × 1.4 mm
body 10 × 10 × 1.4 mm
body 10 × 10 × 1.4 mm
package; no leads; 64 terminals; body
9 × 9 × 0.85 mm
package; no leads; 64 terminals; body
9 × 9 × 0.85 mm
3.1 Ordering options
Table 2.Ordering options
Type numberFlash
memory
LPC2131FBD6432 kB8 kB1-no−40 °C to +85 °C
LPC2131FBD64/0132 kB8 kB1-yes−40 °C to +85 °C
LPC2132FBD6464 kB16 kB 11no−40 °C to +85 °C
LPC2132FBD64/0164 kB16 kB 11yes−40 °C to +85 °C
LPC2132FHN6464 kB16 kB 11no−40 °C to +85 °C
LPC2132FHN64/0164 kB16 kB 11yes−40 °C to +85 °C
LPC2134FBD64128 kB16 kB 21no−40 °C to +85 °C
LPC2134FBD64/01128 kB16 kB 21yes−40 °C to +85 °C
LPC2136FBD64256 kB32 kB 21no−40 °C to +85 °C
LPC2136FBD64/01256 kB32 kB 21yes−40 °C to +85 °C
LPC2138FBD64512 kB32 kB 21no−40 °C to +85 °C
LPC2138FBD64/01512 kB32 kB 21yes−40 °C to +85 °C
LPC2138FHN64512 kB32 kB 21no−40 °C to +85 °C
LPC2138FHN64/01512 kB32 kB 21yes−40 °C to +85 °C
Product data sheetRev. 04 — 16 October 20078 of 39
NXP Semiconductors
LPC2131/32/34/36/38
Single-chip 16/32-bit microcontrollers
5.2 Pin description
Table 3.Pin description
SymbolPinTypeDescription
P0.0 to P0.31I/OPort 0: Port 0 is a 32-bit I/O port with individual direction controls for each bit.
Total of 31 pins of the Port 0 can be used as a general purpose bidirectional
digital I/Os while P0.31 is output only pin. The operation of port 0 pins
depends upon the pin function selected via the pin connect block.
Pin P0.24 is not available.
P0.0/TXD0/
PWM1
P0.1/RXD0/
PWM3/EINT0
P0.2/SCL0/
CAP0.0
P0.3/SDA0/
MAT0.0/EINT1
P0.4/SCK0/
CAP0.1/AD0.6
P0.5/MISO0/
MAT0.1/AD0.7
P0.6/MOSI0/
CAP0.2/AD1.0
P0.7/SSEL0/
PWM2/EINT2
P0.8/TXD1/
PWM4/AD1.1
P0.9/RXD1/
PWM6/EINT3
P0.10/RTS1/
CAP1.0/AD1.2
19
21
22
26
27
29
30
31
33
34
35
[1]
[2]
[3]
[3]
[4]
[4]
[4]
[2]
[4]
[2]
[4]
OTXD0 — Transmitter output for UART0.
OPWM1 — Pulse Width Modulator output 1.
IRXD0 — Receiver input for UART0.
OPWM3 — Pulse Width Modulator output 3.
IEINT0 — External interrupt 0 input.
I/OSCL0 — I2C0 clock input/output. Open drain output (for I2C-bus compliance).
ICAP0.0 — Capture input for Timer 0, channel 0.
I/OSDA0 — I2C0 data input/output. Open drain output (for I2C-bus compliance).
OMAT0.0 — Match output for Timer 0, channel 0.
IEINT1 — External interrupt 1 input.
I/OSCK0 — Serial clock for SPI0. SPI clock output from master or input to slave.
ICAP0.1 — Capture input for Timer 0, channel 1.
IAD0.6 — ADC 0, input 6. This analog input is always connected to its pin.
I/OMISO0 — Master In Slave VDD = 3.6 V for SPI0. Data input to SPI master or
data output from SPI slave.
OMAT0.1 — Match output for Timer 0, channel 1.
IAD0.7 — ADC 0, input 7. This analog input is always connected to its pin.
I/OMOSI0 — Master Out Slave In for SPI0. Data output from SPI master or data
input to SPI slave.
ICAP0.2 — Capture input for Timer 0, channel 2.
IAD1.0 — ADC 1, input 0. This analog input is always connected to its pin.
Available in LPC2134/36/38 only.
ISSEL0 — Slave Select for SPI0. Selects the SPI interface as a slave.
OPWM2 — Pulse Width Modulator output 2.
IEINT2 — External interrupt 2 input.
OTXD1 — Transmitter output for UART1.
OPWM4 — Pulse Width Modulator output 4.
IAD1.1 — ADC 1, input 1. This analog input is always connected to its pin.
Available in LPC2134/36/38 only.
IRXD1 — Receiver input for UART1.
OPWM6 — Pulse Width Modulator output 6.
IEINT3 — External interrupt 3 input.
ORTS1 — Request to Send output for UART1. Available in LPC2134/36/38.
ICAP1.0 — Capture input for Timer 1, channel 0.
IAD1.2 — ADC 1, input 2. This analog input is always connected to its pin.
Product data sheetRev. 04 — 16 October 20079 of 39
NXP Semiconductors
LPC2131/32/34/36/38
Single-chip 16/32-bit microcontrollers
Table 3.Pin description
…continued
SymbolPinTypeDescription
P0.11/CTS1/
CAP1.1/SCL1
37
[3]
ICTS1 — Clear to Send input for UART1. Available in LPC2134/36/38.
ICAP1.1 — Capture input for Timer 1, channel 1.
I/OSCL1 — I
P0.12/DSR1/
MAT1.0/AD1.3
38
[4]
IDSR1 — Data Set Ready input for UART1. Available in LPC2134/36/38.
OMAT1.0 — Match output for Timer 1, channel 0.
IAD1.3 — ADC 1, input 3. This analog input is always connected to its pin.
Available in LPC2134/36/38 only.
P0.13/DTR1/
MAT1.1/AD1.4
39
[4]
ODTR1 — Data Terminal Ready output for UART1. Available in
LPC2134/36/38.
OMAT1.1 — Match output for Timer 1, channel 1.
IAD1.4 — ADC 1, input 4. This analog input is always connected to its pin.
Available in LPC2134/36/38 only.
P0.14/DCD1/
EINT1/SDA1
41
[3]
IDCD1 — Data Carrier Detect input for UART1. Available in LPC2134/36/38.
IEINT1 — External interrupt 1 input.
I/OSDA1 — I
P0.15/RI1/
EINT2/AD1.5
45
[4]
IRI1 — Ring Indicator input for UART1. Available in LPC2134/36/38.
IEINT2 — External interrupt 2 input.
IAD1.5 — ADC 1, input 5. This analog input is always connected to its pin.
Available in LPC2134/36/38 only.
P0.16/EINT0/
MAT0.2/CAP0.2
46
[2]
IEINT0 — External interrupt 0 input.
OMAT0.2 — Match output for Timer 0, channel 2.
ICAP0.2 — Capture input for Timer 0, channel 2.
P0.17/CAP1.2/
SCK1/MAT1.2
47
[1]
ICAP1.2 — Capture input for Timer 1, channel 2.
I/OSCK1 — Serial Clock for SSP. Clock output from master or input to slave.
OMAT1.2 — Match output for Timer 1, channel 2.
P0.18/CAP1.3/
MISO1/MAT1.3
53
[1]
ICAP1.3 — Capture input for Timer 1, channel 3.
I/OMISO1 — Master In Slave Out for SSP. Data input to SPI master or data
output from SSP slave.
OMAT1.3 — Match output for Timer 1, channel 3.
P0.19/MAT1.2/
MOSI1/CAP1.2
54
[1]
OMAT1.2 — Match output for Timer 1, channel 2.
I/OMOSI1 — Master Out Slave In for SSP. Data output from SSP master or data
input to SSP slave.
ICAP1.2 — Capture input for Timer 1, channel 2.
P0.20/MAT1.3/
SSEL1/EINT3
55
[2]
OMAT1.3 — Match output for Timer 1, channel 3.
ISSEL1 — Slave Select for SSP. Selects the SSP interface as a slave.
IEINT3 — External interrupt 3 input.
P0.21/PWM5/
AD1.6/CAP1.3
[4]
1
OPWM5 — Pulse Width Modulator output 5.
IAD1.6 — ADC 1, input 6. This analog input is always connected to its pin.
Available in LPC2134/36/38 only.
ICAP1.3 — Capture input for Timer 1, channel 3.
2
C1 clock input/output. Open drain output (for I2C-bus compliance)
2
C1 data input/output. Open drain output (for I2C-bus compliance).
Product data sheetRev. 04 — 16 October 200710 of 39
NXP Semiconductors
LPC2131/32/34/36/38
Single-chip 16/32-bit microcontrollers
Table 3.Pin description
…continued
SymbolPinTypeDescription
P0.22/AD1.7/
CAP0.0/MAT0.0
[4]
2
IAD1.7 — ADC 1, input 7. This analog input is always connected to its pin.
Available in LPC2134/36/38 only.
ICAP0.0 — Capture input for Timer 0, channel 0.
OMAT0.0 — Match output for Timer 0, channel 0.
P0.2358
P0.25/AD0.4/
9
AOUT
P0.26/AD0.510
P0.27/AD0.0/
11
CAP0.1/MAT0.1
[1]
[5]
[4]
[4]
I/OGeneral purpose digital input/output pin.
IAD0.4 — ADC 0, input 4. This analog input is always connected to its pin.
OAOUT — DAC output. Not available in LPC2131.
IAD0.5 — ADC 0, input 5. This analog input is always connected to its pin.
IAD0.0 — ADC 0, input 0. This analog input is always connected to its pin.
ICAP0.1 — Capture input for Timer 0, channel 1.
OMAT0.1 — Match output for Timer 0, channel 1.
P0.28/AD0.1/
CAP0.2/MAT0.2
13
[4]
IAD0.1 — ADC 0, input 1. This analog input is always connected to its pin.
ICAP0.2 — Capture input for Timer 0, channel 2.
OMAT0.2 — Match output for Timer 0, channel 2.
P0.29/AD0.2/
CAP0.3/MAT0.3
14
[4]
IAD0.2 — ADC 0, input 2. This analog input is always connected to its pin.
ICAP0.3 — Capture input for Timer 0, channel 3.
OMAT0.3 — Match output for Timer 0, channel 3.
P0.30/AD0.3/
EINT3/CAP0.0
15
[4]
IAD0.3 — ADC 0, input 3. This analog input is always connected to its pin.
IEINT3 — External interrupt 3 input.
ICAP0.0 — Capture input for Timer 0, channel 0.
P0.3117
[6]
OGeneral purpose digital output only pin.
Important: This pin MUST NOT be externally pulled LOW when
RESET pin
is LOW or the JTAG port will be disabled.
P1.0 to P1.31I/OPort 1: Port 1 is a 32-bit bidirectional I/O port with individual direction controls
for each bit. The operation of port 1 pins depends upon the pin function
selected via the pin connect block. Pins 0 through 15 of port 1 are not
available.
P1.16/
16
[6]
OTRACEPKT0 — Trace Packet, bit 0. Standard I/O port with internal pull-up.
TRACEPKT0
P1.17/
12
[6]
OTRACEPKT1 — Trace Packet, bit 1. Standard I/O port with internal pull-up.
TRACEPKT1
P1.18/
[6]
8
OTRACEPKT2 — Trace Packet, bit 2. Standard I/O port with internal pull-up.
TRACEPKT2
P1.19/
[6]
4
OTRACEPKT3 — Trace Packet, bit 3. Standard I/O port with internal pull-up.
TRACEPKT3
P1.20/
TRACESYNC
48
[6]
OTRACESYNC — Trace Synchronization. Standard I/O port with internal
pull-up. LOW on TRACESYNC while
RESET is LOW enables pins P1.25:16
to operate as Trace port after reset.
P1.21/
44
[6]
OPIPESTAT0 — Pipeline Status, bit 0. Standard I/O port with internal pull-up.
PIPESTAT0
P1.22/
40
[6]
OPIPESTAT1 — Pipeline Status, bit 1. Standard I/O port with internal pull-up.
PIPESTAT1
P1.23/
36
[6]
OPIPESTAT2 — Pipeline Status, bit 2. Standard I/O port with internal pull-up.
Product data sheetRev. 04 — 16 October 200711 of 39
NXP Semiconductors
LPC2131/32/34/36/38
Single-chip 16/32-bit microcontrollers
Table 3.Pin description
…continued
SymbolPinTypeDescription
P1.24/
32
[6]
OTRACECLK — Trace Clock. Standard I/O port with internal pull-up.
TRACECLK
P1.25/EXTIN028
P1.26/RTCK24
[6]
[6]
IEXTIN0 — External Trigger Input. Standard I/O with internal pull-up.
I/ORTCK — Returned Test Clock output. Extra signal added to the JTAG port.
Assists debugger synchronization when processor frequency varies.
Bidirectional pin with internal pull-up. LOW on RTCK while
enables pins P1.31:26 to operate as Debug port after reset.
P1.27/TDO64
P1.28/TDI60
P1.29/TCK56
P1.30/TMS52
TRST20
P1.31/
RESET57
[6]
[6]
[6]
[6]
[6]
[7]
OTDO — Test Data out for JTAG interface.
ITDI — Test Data in for JTAG interface.
ITCK — Test Clock for JTAG interface.
ITMS — Test Mode Select for JTAG interface.
ITRST — Test Reset for JTAG interface.
IExternal reset input: A LOW on this pin resets the device, causing I/O ports
and peripherals to take on their default states, and processor execution to
begin at address 0. TTL with hysteresis, 5 V tolerant.
XTAL162
XTAL261
RTCX13
RTCX25
V
SS
[8]
[8]
[8]
[8]
IInput to the oscillator circuit and internal clock generator circuits.
OOutput from the oscillator amplifier.
IInput to the RTC oscillator circuit.
OOutput from the RTC oscillator circuit.
6, 18, 25, 42,50IGround: 0 V reference.
RESET is LOW
V
SSA
V
DD
59IAnalog ground: 0 V reference. This should nominally be the same voltage
as V
, but should be isolated to minimize noise and error.
SS
23, 43, 51I3.3 V power supply: This is the power supply voltage for the core and I/O
ports.
V
DDA
7IAnalog 3.3 V power supply: This should be nominally the same voltage as
V
but should be isolated to minimize noise and error. This voltage is used
DD
to power the on-chip PLL.
VREF63IADC reference: This should be nominally the same voltage as V
DD
but
should be isolated to minimize noise and error. Level on this pin is used as a
reference for A/D and D/A convertor(s).
VBAT49IRTC power supply: 3.3 V on this pin supplies the power to the RTC.
[1] 5 V tolerant pad providing digital I/O functions with TTL levels and hysteresis and 10ns slew rate control.
[2] 5 V tolerant pad providing digital I/O functions with TTL levels and hysteresis and 10ns slew rate control. If configured for an input
function, this pad utilizes built-in glitch filter that blocks pulses shorter than 3 ns.
[3] Open drain 5 V tolerant digital I/O I2C-bus 400 kHz specification compatible pad. It requires external pull-up to provide an output
functionality.
[4] 5 V tolerant pad providing digital I/O (with TTL levels and hysteresisand10 ns slewratecontrol)andanaloginputfunction.If configured
for an input function, this pad utilizes built-in glitch filter that blocks pulses shorter than 3 ns. When configured as an ADC input, digital
section of the pad is disabled.
[5] 5 V tolerant pad providing digital I/O (with TTL levels and hysteresis and 10ns slew rate control) and analog output function. When
configured as the DAC output, digital section of the pad is disabled.
[6] 5 V tolerant pad with built-in pull-up resistor providing digital I/O functions with TTL levels and hysteresis and 10 ns slew rate control.
The pull-up resistor’s value ranges from 60 kΩ to 300 kΩ.
[7] 5 V tolerant pad providing digital input (with TTL levels and hysteresis) function only.
[8] Pad provides special analog functionality.