LPC23xx series are ARM-based microcontrollers for applications requiring serial
communications for a variety of purposes. These microcontrollers typica lly incorporate a
10/100 Ethernet MAC, USB 2.0 Full Speed interface, four UARTs, two CAN channels, an
SPI interface, two Synchronous Serial Ports (SSP), thr ee I2C interfaces, an I
and a MiniBus (8-bit data/16-bit address parallel bus).
2.How to read this manual
The term “LPC23xx“ in the following text will be used as a generic name for all parts
covered in this user manual:
• LPC2361/62
• LPC2364/65/66/67/68
• LPC2377/78
• LPC2387
• LPC2388
2
S interface,
3.Features
3.1General features
Only when needed, a specific device name will be used to distinguish the part. See
• Up to 512 kB on-chip Flash Program Memory with In-System Prog ramming (ISP) a nd
In-Application Programming (IAP) capabilities. Single Flash sector or full-chip erase in
400 ms and 256 bytes programming in 1 ms. Flash program memory is on the ARM
local bus for high performance CPU access.
• Up to 64 kB of SRAM on the ARM local bus for high performance CPU access.
• 16 kB St atic RAM for Ethernet inter face. Can also be used as general purpo se SRAM.
• 8 kB Static RAM for general purpose or USB interface.
• Dual AHB system that provides for simultaneous Ethernet DMA, USB DMA, and
• Advanced Vector ed Interrupt Controller, supporting up to 32 vectored interrupts.
• General Purpose DMA controller (GPDMA) on AHB that can be used with the SSP
• Serial Interfaces:
• Other APB Peripherals:
UM10211
Chapter 1: LPC23XX Introductory information
program execution from on-chip flash with no contention between those functions. A
bus bridge allows the Ethernet DMA to access the other AHB subsystem.
serial interfaces, the I
memory-to-memory transfers.
– Ethernet MAC with associated DMA controller. These functions reside on an
independent AHB bus.
– On LPC2364/66/68, LPC2378, LPC2387, LPC2388: USB 2.0 device controller
with on-chip PHY and associated DMA controller.
– On LPC2388: USB Host/OTG controller.
– Four UARTs with fractional baud rate generation, one with modem control I/O, one
with IrDA support, all with FIFO. These reside on the APB bus.
– SPI controller, residing on the APB bus.
– Two SSP controllers with FIFO and multi-protocol capabilities. One is an alternate
for the SPI port, sharing its interrupt. The SSP controllers can be used with the
GPDMA controller and reside on the APB bus.
2
– Three I
are expansion I
2
I
2
– I
bus. The I
– On LPC2364/66/68, LPC2378, LPC2387, LPC2388: Two CAN channels with
Acceptance Filter/FullCAN mode residing on the APB bus.
– On LPC2367/68, LPC2377/78, LPC2387, LPC2388: Secure Digital (SD) /
MultiMediaCard (MMC) memory card interface.
– Up to 70 (100 pin packages) or 104 (144 pin packages) general purpose I/O pins.
– 10 bit A/D converter with input multiplexing among 6 pins (100 pin packages) or 8
pins (144 pin packages).
– 10 bit D/A converter.
– Four general purpose timers with two capture inputs each and up to four compare
output pins each. Each timer block has an external count input.
– One PWM/Timer block with support for three-phase motor control. The PWM has
two external count inputs.
– Real-Time Clock (RTC) with separate power pin; clock source can be the RTC
oscillator or the APB clock.
– 2 kB Static RAM powered from the RTC power pin , allowing data to be stored
when the rest of the chip is powered off.
C interfaces reside on the APB bus. The second and third I2C interfaces
C pins.
S (Inter-IC Sound) interface for digital audio input or output, residing on the APB
2
S interface can be used with the GPDMA.
2
S port, and the SD/MMC card port, as well as for
2
C interfaces with standard port pins rather than specia l open-drain
The LPC2300 consists of an ARM7TDMI-S CPU with emulation support, the ARM7 Local
Bus for closely coupled, high speed access to the majority of on-chip memory, the AMBA
Advanced High-performance Bus (AHB) interfacing to high speed on-chip peripherals an d
external memory, and the AMBA Advanced Peripheral Bus (APB) for connection to other
on-chip peripheral functions. The microcontroller permanently configures the
ARM7TDMI-S processor for little-endian byte order.
The microcontroller implements two AHB buses in order to allow the Etherne t block to
operate without interference caused by other system activity. The primary AHB, referred
to as AHB1, includes the V ectored Interrupt Controller, General Purpose DMA Controller,
External Memory Controller, USB interface, and 8/16 kB SRAM primarily intended for use
by the USB.
The second AHB, referred to as AHB2, includes only the Ethernet block and an
associated 16 kB SRAM. In addition, a bus bridge is provided that allows the secondary
AHB to be a bus master on AHB1, allowing expansion of Ethernet buffer space into
off-chip memory or unused space in memory resid ing on AHB1.
In summary, bus masters with access to AHB1 are the ARM7 itself, the USB block, the
General Purpose DMA function, and the Ethernet block (via the bus bridge from AHB2).
Bus masters with access to AHB2 are the ARM7 and the Ethernet block.
AHB peripherals are allocated a 2 MB range of addresses at the very top of the 4 GB
ARM memory space. Each AHB peripheral is allocated a 16 kB address space within the
AHB address space. Lower speed peripheral functions are connected to the APB bus.
The AHB to APB bridge interfaces the APB bus to the AHB bus. APB peripherals are also
allocated a 2 MB range of addresses, beginning at the 3.5 GB address point. Each APB
peripheral is allocated a 16 kB address space within the APB address space.
7.ARM7TDMI-S processor
The ARM7TDMI-S is a general purpose 32 bit microprocessor, which offers high
performance and very low power consumption. The ARM architecture is based on
Reduced Instruction Set Computer (RISC) principles, and the instruction set and related
decode mechanism are much simpler than those of microprogrammed Complex
Instruction Set Computers. This simplicity results in a high instruction throughput and
impressive real-time interrupt response from a small and cost-effective processor core.
UM10211
Chapter 1: LPC23XX Introductory information
Pipeline techniques are employed so that all pa rts of the p rocessing and memory systems
can operate continuously. Typically, while one instruction is being executed, its successor
is being decoded, and a third instruction is being fetched from memory.
The ARM7TDMI-S processor also employs a unique architectural strategy known as
THUMB, which makes it ideally suited to high-volume applications with memory
restrictions, or applications where code density is an issue.
The key idea behind THUMB is that of a super-reduced instruction set. Essentially, the
ARM7TDMI-S processor has two instruction sets:
• The standard 32 bit ARM instruction set.
• A 16 bit THUMB instruction set.
The THUMB set’s 16 bit instruction length allows it to approach twice the density of
standard ARM code while retaining most of the ARM’s performance advantage over a
traditional 16 bit processor using 16 bit registers. This is possible because THUMB code
operates on the same 32 bit register set as ARM code.
THUMB code is able to provide up to 65% of the code size of ARM, and 160% of the
performance of an equivalent ARM processor connected to a 16 bit memory system.
The ARM7TDMI-S processor is described in detail in the ARM7TDMI-S Datasheet that
can be found on official ARM website.
The LPC2300 includes a Flash memory system with up to 512 kB. This memory may be
used for both code and data storage. Programming of the Flash memory may be
accomplished in several ways. It may be programmed In System via the serial port. The
application program may also erase and/or program the Flash while the application is
running, allowing a great degree of flexibility for data storage field firmware upgrades, etc.
The Flash is 128 bits wide and includes pre -fetching and buf fering techniques to allow it to
operate at SRAM speeds.
9.On-chip Static RAM
The LPC2300 includes a static RAM memory up to 64 kB in size, that may be used for
code and/or data storage.
The SRAM controller incorporates a write-back buffer in order to prevent CPU stalls
during back-to-back writes. The write-back buffer always holds the last data sent by
software to the SRAM. The data is only written to the SRAM when software does another
write. After a "warm" chip reset, the SRAM does not reflect the last write operation. Two
identical writes to a location guarantee that the data will be present after a Reset.
Alternatively, a dummy write operation before entering idle or power-down mode will
similarly guarantee that the last data written will be present after a subsequent Reset.
ARM processors have a single 4 GB address space. The following table shows how this
space is used on NXP embedded ARM devices. For memory option det ails see Table 1–2
Table 9.LPC2300 memory usage
Address range General useAddress range details and description
0x0000 0000 to
0x3FFF FFFF
0x4000 0000 to
0x7FFF FFFF
0x8000 0000 to
0xDFFF FFFF
0xE000 0000 to
0xEFFF FFFF
0xF000 0000 to
0xFFFF FFFF
on-chip
NV memory
and fast I/O
on-chip RAM0x4000 0000 - 0x4000 7FFFRAM (up to 32 kB)
off-chip memoryTwo static memory banks, 64 KB each (LPC2377/78 and LPC2388 only):
The LPC2300 incorporates several distinct memory regions, shown in the following
figures. Figure 2–7
address space from the user program viewpoint following reset. Th e interrupt vector area
supports address remapping, which is described later in this section.
Figure 12 and Table 2–10 show different views of the peripheral address space. Both the
AHB and APB peripheral areas are 2 megabyte spaces which are divided up into 128
peripherals. Each peripheral space is 16 kilobytes in size. This allows simplifying the
address decoding for each peripheral.
All peripheral register addresses are word aligned (to 32 bit boundaries) regardless of
their size. This eliminates the need for byte lane mapping hardware that would be required
to allow byte (8 bit) or half-word (16 bit) accesses to occur at smaller boundaries. An
implication of this is that word and half-word registers must be accessed all at once. For
example, it is not possible to read or write the upper byte of a word register separately.
The following table shows the APB address map. No APB peripheral uses all of the 16 kB
space allocated to it. T ypically each device’ s registers are "aliased" or re peated at multiple
locations within each 16 kB range.
Table 10.APB peripherals and base addresses
APB PeripheralBase AddressPeripheral Name
00xE000 0000Watchdog Timer
10xE000 4000Timer 0
20xE000 8000Timer 1
30xE000 C000UART0
40xE001 0000UART1
50xE001 4000Not used
60xE001 8000PWM1
70xE001 C000I
80xE002 0000SPI
90xE002 4000RTC
100xE002 8000GPIO
1 10xE002 C000Pin Connect Block
120xE003 0000SSP1
130xE003 4000ADC
140xE003 8000CAN Acceptance Filter RAM
150xE003 C000CAN Acceptance Filter Registers
160xE004 0000CAN Common Registers
170xE004 4000CAN Controller 1
180xE004 8000CAN Controller 2
19 to 220xE004 C000 to 0xE005 8000Not used
230xE005 C000I
240xE006 0000Not used
250xE006 4000Not used
260xE006 8000SSP0
270xE006 C000DAC
280xE007 0000Timer 2
290xE007 4000Timer 3
300xE007 8000UART2
310xE007 C000UART3
320xE008 0000I
330xE008 4000Battery RAM
340xE008 8000I2S
350xE008 C000SD/MMC Card Interface
36 to 1260xE009 0000 to 0xE01F BFFFNot used
1270xE01F C000System Control Block
UM10211
Chapter 2: LPC23XX memory addressing
2
C0
[1]
[1]
[1]
[1]
[1]
2
C1
2
C2
[2]
[1] CAN interface is available in LPC2364/66/68, LPC2378, LPC2387, and LPC2388.
[2] The SD/MMC card interface is available in LPC2365/66, LPC2377/78, LPC2387, and LPC2388.
4.LPC2300 memory re-mapping and boot ROM
4.1Memory map concepts and operating modes
The basic concept on the LPC2300 is that each memory area has a "natural" location in
the memory map. This is the address range for which code residing in that area is written.
The bulk of each memory space remains permanently fixed in the same location,
eliminating the need to have portions of the code designed to run in different address
ranges.
Because of the location of the interrupt vectors on the ARM7 processor (at addresses
0x0000 0000 through 0x0000 001C, as shown in Table 2–11
Boot ROM and SRAM spaces need to be re-mapped in order to allow alternative uses of
interrupts in the differen t operating modes described in Table 2–12
interrupts is accomplished via the Memory Mapping Contro l feature (Section 2–5 “
The Boot Loader always executes after any reset. The Boot ROM
interrupt vectors are mapped to the bottom of memory to allow
handling exceptions and using interrupts during the Boot Loading
process. A sector of the Flash memory (the Boot Flash) is available to
hold part of the Boot Code.
.
NXP Semiconductors
Table 12. LPC2300 Memory mapping modes
ModeActivationUsage
User
Flash
mode
User RAM
mode
User
External
Memory
mode
[1] See EMCControl register address mirror bit in Table5–60 for address of external memory bank 0.
4.2Memory re-mapping
In order to allow for compatibility with future derivatives, the entire Boot ROM is mapped
to the top of the on-chip memory space. In this manner, the use of larger or smaller flash
modules will not require changing the location of the Boot ROM (which would require
changing the Boot Loader code itself) or changing the mapping of the Boot ROM interru pt
vectors. Memory spaces other than the interrupt vectors remain in fixed locations.
Figure 2–13
UM10211
Chapter 2: LPC23XX memory addressing
Software
activation by
boot code
Software
activation by
user program
Software
activation by
user code
shows the on-chip memory mapping in the modes defined above.
Activated by the Boot Loader when a valid User Program Signature is
recognized in memory and Boot Loader operation is not forced.
Interrupt vectors are not re-mapped and are found in the bottom of the
Flash memory.
Activated by a User Program as desired. Interrupt vectors are
re-mapped to the bottom of the Static RAM.
Activated by a User Program as desired. Interrupt vectors are
re-mapped to external memory bank 0
[1]
.
The portion of memory that is re-mapped to allow interrupt processing in different modes
includes the interrupt vector area (32 bytes) and an additional 32 bytes for a total of
64 bytes, that facilitates branching to interrupt handlers at distant physical addresses. The
remapped code locations overlay addresses 0x0000 0000 through 0x0000 003F. A typical
user program in the Flash memory can place the entire FIQ handler at address
0x0000 001C without any need to consider mem or y bo un d ar ies. The vector contained in
the SRAM, external memory , and Boot ROM must cont ain branches to the actual interrupt
handlers, or to other instructions that accomplish the branch to the interrupt hand lers.
There are three reasons this configuration was chosen:
1. To give the FIQ handler in the Flash memory the advantage of not having to take a
memory boundary caused by the remapping into account.
2. Minimize the need to for the SRAM and Boot ROM vectors to deal with arbitrary
boundaries in the middle of code space.
3. To provide space to store constants for jumping beyond the range of single word
branch instructions.
Re-mapped memory areas, including the Boot ROM and interrupt vectors, continue to
appear in their original location in addition to the re-mapped address.
Details on re-mapping and examples can be found in Section 2–5 “
The Memory Mapping Control alters the mapping of the interrupt vectors that appear
beginning at address 0x0000 0000. This allows code running in different memory spaces
to have control of the interrupts.
5.1Memory Mapping Control Register (MEMMAP - 0xE01F C040)
Whenever an exception handling is necessary, microcontroller will fetch an instruction
residing on exception corresponding address as described in Table 2–11 “
vector locations” on page 25. The MEMMAP register determines the source of data that
will fill this table.
Table 13.Memory mapping control registers
NameDescriptionAccessReset
MEMMAP Memory mapping control. Selects whether the
ARM interrupt vectors are read from the Boot
ROM, User Flash, or RAM.
UM10211
Chapter 2: LPC23XX memory addressing
ARM exception
Address
value
R/W0x000xE01F C040
Table 14.Memory Mapping control register (MEMMAP - address 0xE01F C040) bit
description
BitSymbol Value DescriptionReset
1:0MAP00Boot Loader Mode. Interrupt vectors are re-mapped to Boot ROM. 00
01User Flash Mode. Interrupt vectors are not re-mapped and reside
in Flash.
10User RAM Mode. Interrupt vectors are re-mapped to Static RAM.
11User External Memory Mode (available on LPC2377/78 and
LPC2388 only).
Warning: Improper setting of this value may result in incorrect operation of
the device.
7:2--Reserved, user software should not write ones to reserved bits.
The value read from a reserved bit is not defined.
5.2Memory mapping control usage notes
Memory Mapping Control simply selects one out of three available sources of data (set s of
64 bytes each) necessary for handling ARM exceptions (interrupts).
For example, whenever a Software Interrupt request is generated, ARM core will always
fetch 32 bit data "residing" on 0x0000 0008 see Table 2–11 “
locations” on page 25. This means that when MEMMAP[1:0] = 10 (User RAM Mode),
read/fetch from 0x0000 0008 will provide data stored in 0x4000 0008. In case of
MEMMAP[1:0] = 00 (Boot Loader Mode), read/fetch from 0x0000 0008 will provide data
available also at 0x7FFF E008 (Boot ROM remapped from on-chip Bootloader).
The LPC2300 generates the appropriate bus cycle abort exception if an access is
attempted for an address that is in a reserved or unassigned address region. The regions
are:
• Areas of the memory map that are not implemented for a specific ARM derivative. Fo r
the LPC2300, this is:
– Address space between On-Chip Non-Volatile Memory and the Special Register
space. Labelled "Reserved for On-Chip Memory" in Figure 2–7
Figure 2–9
– Address space between On-Chip Static RAM and the Boot ROM. Labelled
"Reserved Address Space" in Figure 2–7
– External Memory
– Reserved regions of the AHB and APB spaces. See Figure 2–11
• Unassigned AHB peripheral spaces. See Figure 2–12.
• Unassigned APB peripheral spaces. See Table 2–10.
.
UM10211
Chapter 2: LPC23XX memory addressing
, Figure 2–8, and
, Figure 2–8, and Figure 2–9.
.
For these areas, both attempted data acce ss and in struction fetch genera te an exception.
In addition, a Prefetch Abort exception is generated for an y instruction fetch that maps to
an AHB or APB peripheral address, or to the Special Register space located just below
the SRAM at addresses 0x3FFF8000 through 0x3FFFFFFF.
Within the address space of an existing APB peripheral, a data abort exception is not
generated in response to an access to an undefined address. Address decoding within
each peripheral is limited to that needed to distinguish defined registers within the
peripheral itself. For example, an access to address 0xE000 D000 (an undefined addre ss
within the UART0 space) may result in an access to the register defined at address
0xE000 C000. Details of such address aliasing within a peripheral space are not defined
in the LPC2300 documentation and are not a supporte d feature.
If software executes a write directly to the Flash memory, the MAM generates a data abort
exception. Flash programming must be accomplished using the specified Flash
programming interface provided by the Boot Code.
Note that the ARM core stores the Prefetch Abort flag along with the associated
instruction (which will be meaningless) in the pipeline and processes the abort only if an
attempt is made to execute the instruction fetched from the illegal address. This prevents
accidental aborts that could be caused by prefetches that occur when code is executed
very near a memory boundary.
The system control block includes several system features and control registers for a
number of functions that are not related to specific peripheral devices. These include:
• Reset
• Brown-Out Detection
• External Interrupt Input s
• Miscellaneous System Controls and Status
• Code Security vs. Debugging
Each type of function has its own register(s) if any are required and unneeded bit s are
defined as reserved in order to allow future expansion. Unrelated functions never share
the same register addresses
2.Pin description
Table 3–15 shows pins that are associated with System Control block functions.
Table 15.Pin summary
Pin namePin
EINT0InputExternal Interrupt Input 0 - An active low/high level or
EINT1InputExternal Interrupt Input 1 - See the EINT0 description ab ove.
EINT2InputExternal Interrupt Input 2 - See the EINT0 description ab ove.
EINT3InputExternal Interrupt Input 3 - See the EINT0 description ab ove.
RESET
3.Register description
All registers, regardless of size, are on word address boundaries. Details of the registers
appear in the description of each function.