• Modifications to the user manual applicable to parts LPC1311/01 and LPC1313/01 only:
– SSP1 added for part LPC1313FBD48/01 in Chapter 3 “LPC13xx System
configuration” and Chapter 14 “LPC13xx SSP0/1”.
– UART functions for part LPC1313FBD48/01 added in Table 128, Table 129, , and
Table 138.
– Use of IRC for entering deep power-down updated in Section 3.9.4.2.
– Enable sequence for UART clock updated in Section 12.1.
– Chapter 5 “LPC13xx Power profiles” added.
– Register IOCON_DSR_LOC (Table 140), IOCON_DCD_LOC (Table 141),
IOCON_RI_LOC (Table 142) added.
– Programmable bit OD for pseudo open-drain mode added to IOCON registers in
The LPC13xx are ARM Cortex-M3 based microcontrollers for embedded applications
featuring a high level of integration and low power consumption. The ARM Cortex-M3 is a
next generation core that offers system enhancements such as enhanced debug features
and a higher level of support block integration.
The LPC13xx operate at CPU frequencies of up to 72 MHz. The ARM Cortex-M3 CPU
incorporates a 3-stage pipeline and uses a Harvard arc hit ec tu re with separat e local
instruction and data buses as well as a third bus for peripherals. The ARM Cortex-M3
CPU also includes an internal prefetch unit that supports speculative branching.
The peripheral complement of the LPC13xx series includes up to 32 kB of flash memory,
up to 8 kB of data memory, USB Device, one Fast-mode Plus (FM+) I
UART, four general purpose timers, and up to 42 general purpose I/O pins.
1.2 How to read this manual
This user manual describes parts LPC1311, LPC1313, LPC1342, LPC1343. Part-specific
features and registers are listed at the beginning of each chapter.
Remark: The LPC13xx series consists of the LPC1300 series (parts LPC1311/13/42/43)
and the LPC1300L series (parts LPC1311/01 and LPC1313/01). The LPC1300L series
features the following enhancements over the LPC1300 series:
• Power profiles with lower power consumption in Active and Sleep modes.
• Four levels for BOD forced reset.
• Second SSP controller (LPC1313FBD48/01 only).
• Windowed Watchdog Timer (WWDT).
• Internal pull-up resistors pull up pins to full V
• Programmable pseudo open-drain mode for GPIO pins.
1.3 Features
DD
level.
2
C interface, one
• ARM Cortex-M3 processor, running at frequencies of up to 72 MHz.
• ARM Cortex-M3 built-in Nested Vectored Interrupt Controller (NVIC).
Figure 2 shows the memory and peripheral address space of the LPC13xx.
The AHB peripheral area is 2 MB in size and is divided to allow for up to 128 peripherals.
On the LPC13xx, the GPIO ports are the only AHB peripherals. The APB peripheral area
is 512 kB in size and is divided to allow for up to 32 peripherals. Each peripheral of either
type is allocated 16 kB of space. This allows simplifying the address decoding for each
peripheral.
All peripheral register addresses are 32-bit word aligned regardless of their size. 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.
PDAWAKECFGR/W0x234Power-down st ates after wake-up from
PDRUNCFGR/W0x238Power-down configuration register bits 8 and 10
are reserved for parts LPC1311 and LPC1313:
DescriptionRegister bits
offset
mode
Deep-sleep mode
reserved for
LPC1311/13
bits 8 and 10
bits 8 and 10
SSP1
The SSP1 block is available on the LPC1313FBD48/01 only. SSP1 related registers and
register bits are reserved for the following parts: LPC1311/13/42/43 and
LPC1311FHN33/01 and LPC1313FHN33/01.
BOD control
The number of programmable BOD levels for forced reset is different for the LPC1300 and
the LPC1300L series. See Table 5
. The BOD trip levels for the LPC1300 and LPC1300L
series are listed in the LPC1311/13/42/43 data sheet.
For HVQFN packages, the start logic control bits (see Table 44
for port pins PIO2_1 to PIO2_11 and PIO3_0, PIO3_1, and PIO3_3.
PIO reset status registers
For HVQFN packages, the reset status bits (see Table 40
port pins PIO2_1 to PIO2_11 and PIO3_0 and PIO3_1, and PIO3_3.
Entering Deep power-down mode
Status of the IRC before entering Deep power-down mode (see Section 3 .9.4.2
to Table 51) are reserved
and Table 41) are reserved for
):
• IRC must be enabled for parts LPC1311/13/42/43.
• IRC status has no effect for parts LPC1311/01 and LPC1313/01.
Enabling sequence for UART cloc k
Requirements for enabling the UART pe ripheral clock:
• The UART pins must be configured in the IOCON block before the UART clock can be enabled
in the SYSAHBCLKCTRL register (Table 25) for parts LPC1311/13/42/43.
in the
• The sequence of configuring the UART pins and the UART clock has no effect for
parts LPC1311/01 and LPC1313/01.
Deep-sleep mode configuration
Register values configuring the Deep-sleep mode are different for the LPC1300 (parts
LPC1311/13/42/43) and LPC1300L (parts LPC1311/01 and LPC1313/01) series (see
Section 3.5.45
, the PDSLEEPCFG register).
3.2 Introduction
The system configuration block controls oscillators, the power management unit, and
clock generation of the LPC13xx. Also included in this block are registers for setting the
priority for AHB access and a register for remapping flash, SRAM, and ROM memory
areas.
See Figure 3 for an overview of the LPC13xx Clock Generation Unit (CGU).
The LPC131x include three independent oscillators. These are the system oscillator, the
Internal RC oscillator (IRC), and the Watchdog oscillator. Each oscillator can be used for
more than one purpose as required in a particular application.
Following reset, the LPC131x will operate from the Internal RC oscillator until switched by
software. This allows systems to operate without any external crystal and the bootloader
code to operate at a known frequency.
The SYSAHBCLKCTRL register gates the system clock to the various peripherals and
memories. UART, SSP0/1, the SysTick timer, and the ARM trace clock have individual
clock dividers to derive peripheral clocks from the main clock.
The USB clock, if available, and the watchdog clock, can be derived from the oscillator
output or the main clock.
The main clock, and the clock outputs from the IRC, the system oscillator, and the
watchdog oscillator can be observed directly on the CLKOUT pin.
START SRP0R0x20CStart logic status register 0; bottom 32
interrupts
START APRP1R/W0x210Start logic edge control register 1; top 8
interrupts
STARTERP1R/W0x214Start logic signal enable register 1; top 8
interrupts
STARTRSRP1CLRW0x218Start logic reset register 1; top 8
interrupts
STARTSRP1R0x21CStart logic status register 1; top 8
interrupts
--0x220 - 0x22CReserved-PDSLEEPCFGR/W0x230Power-down states in Deep-sleep mode0x0000 0000 Table 53
PDAWAKECFGR/W0x234Power-down states after wake-up from
Table 8.System memory remap register (SYSMEMREMAP, address 0x4004 8000) bit
BitSymbolValueDescriptionReset
1:0MAPSystem memory remap10
31:2--Reserved0x00
3.5.2 Peripheral reset control register
This register allows software to reset the SSP0/1 and I2C peripherals. Writing a 0 to the
SSP0/1_RST_N or I2C_RST_N bits resets the SSP0/1 or I2C peripherals. Writing a 1
de-asserts the reset.
UM10375
Chapter 3: LPC13xx System configuration
description
value
0x0Boot Loader Mode. Interrupt vectors are re-mapped to Boot
ROM.
0x1User RAM Mode. Interrupt vectors are re-mapped to Static
RAM.
0x2User Flash Mode. Interrupt vectors are not re-mapped and
reside in Flash.
Remark: Before accessing the SSP0/1 and I2C peripherals, write a 1 to this register to
ensure that the reset signals to the SSP0/1 and I2C are de-asserted.
Table 9.Peripher al reset control register (PRESETCTRL, address 0x4004 8004) bit
description
BitSymbolValue DescriptionReset
0SSP0_RST_NSSP0 reset control0
0Reset SSP0.
1De-assert SSP0 reset.
1I2C_RST_NI2C reset control0
0Reset I2C.
1De-asset I2C reset.
2SSP1_RST_NSSP1 reset control0
0Reset the SSP1.
1De-assert SSP1 reset.
31:3--Reserved0x00
3.5.3 System PLL control register
This register connects and enables the system PLL a nd configur es the PLL multiplie r and
divider values. The PLL accepts an input frequency from 10 MHz to 25 MHz from various
clock sources. The input frequency is multiplied up to a high frequency, then divided down
to provide the actual clock used by the CPU, peripherals, and optionally the USB
subsystem. Note that the USB subsystem has its own dedicated PLL. The PLL can
produce a clock up to the maximum allowed for the CPU, which is 72 MHz.
Table 10. System PLL control register (SYSPLLCTRL, address 0x4004 8008) bit description
BitSymbolValueDescriptionReset
4:0MSELFeedback divider value. The division value M is the
6:5PSELPost divider ratio P. The division ratio is 2 P.0x00
31:7--Reserved. Do not write ones to reserved bits.0x00
3.5.4 System PLL status register
This register is a Read-only register and supplies the PLL lock status (see Section 3.11.1).
Table 11. System PLL status register (SYSPLLSTAT, address 0x4004 800C) bit description
BitSymbolValueDescriptionReset
0LOCKPLL lock status0x0
31:1--Reserved0x00
UM10375
Chapter 3: LPC13xx System configuration
value
0x000
programmed MSEL value + 1.
00000: Division ratio M = 1
to
11111: Division ratio M = 32.
0x0P = 1
0x1P = 2
0x2P = 4
0x3P = 8
value
0PLL not locked
1PLL locked
3.5.5 USB PLL control register
The USB PLL is identical to the system PLL and is used to provide a dedicated clock to
the USB block if available (see Section 3.1
This register connects and enables the USB PLL and configures the PLL multiplier and
divider values. The PLL accepts an input frequency from 10 MHz to 25 MHz from various
clock sources. The input frequency is multiplied up to a high frequency, then divided down
to provide the actual clock 48 MHz clock used by the USB subsystem.
Remark: The USB PLL must be connected to the system oscillator for correct USB
operation (see Table 20
Table 12. USB PLL control register (USBPLLCTRL, address 0x4004 8010) bit description
BitSymbolValueDescriptionReset
4:0MSELFeedback divider value. The division value M is the
This register configures the frequency range for the system oscillator.
Table 14. System oscillator control register (SYSOSCCTRL, address 0x4004 8020) bit
BitSymbolValueDescriptionReset
0BYPASSBypass system oscillator0x0
1FREQRANGEDetermines frequency range for Low-power
31:2--Reserved0x00
UM10375
Chapter 3: LPC13xx System configuration
description
value
0Oscillator is not bypassed.
1Bypass enabled. PLL input (sys_osc_clk) is fed
directly from the XTALIN and XTALOUT pins.
0x0
oscillator.
01 - 20 MHz frequency range.
115 - 25 MHz frequency range
3.5.8 Watchdog oscillator control register
This register configures the watchdog oscillator. The oscillator consists of an analog and a
digital part. The analog part contains the oscillator function and generates an analog clock
(Fclkana). With the digital part, the analog output clock (Fclkana) can be divided to the
required output clock frequency wdt_osc_clk. The analog output frequency (Fclkan a) can
be adjusted with the FREQSEL bits between 500 kHz and 3.4 MHz. With the digital part
Fclkana will be divided (divider ratios = 2, 4,...,64) to wdt_osc_clk using the DIVSEL bits.
The output clock frequency of the watchdog oscillator can be calculated as
wdt_osc_clk = Fclkana/(2 (1 + DIVSEL)) = 7.8 kHz to 1.7 MHz (nominal values).
Remark: Any setting of the FREQSEL bits will yield a Fclkana value within 40% of the
listed frequency value. The watchdog oscillator is the clock source with the lowest power
consumption. If accurate timing is required, use the IRC or system clock.
Remark: The frequency of the watchdog oscillator is undefined after reset. The watchdog
oscillator frequency must be programmed by writing to the WDTOSCCTRL register before
using the watchdog oscillator.
Table 15. Watchdog oscillator control register (WDTOSCCTRL, address 0x4004 8024) bit
The SYSRSTSTAT register shows the source of the latest reset event. The bits are
cleared by writing a one to any of the bits. The POR event clears all other bits in this
register, but if an othe r re se t signal ( e.g., EXTRST) remains asserted after the POR signal
is negated, then its bit is set to detected.
Table 17. System reset status register (SYSRESSTAT, address 0x4004 8030) bit description
BitSymbolValueDescriptionReset
0PORPOR reset status0x0
1EXTRST0x0
2WDTStatus of the Watchdog reset0x0
3BODStatus of the Brown-out detect reset0x0
4SYSRSTStatus of the software system reset. The ARM software
31:5--Reserved0x00
Chapter 3: LPC13xx System configuration
0No POR detected
1POR detected
0No RESET
1RESET
0No WDT reset detected
1WDT reset detected
0No BOD reset detected
1BOD reset detected
reset has the same effect as the hardware reset using the
RESET
0No System reset detected
1System reset detected
event detected
detected
pin.
UM10375
value
0x0
3.5.11 System PLL clock source select register
This register selects the clock source for the system PLL. The SYSPLLCLKUEN register
(see Section 3.5.12
Remark: The system oscillator must be selected if the system PLL is used to generate a
48 MHz clock to the USB block.
Remark: When switching clock sources, both clocks must be running before the clock
source is updated.
) must be toggled from LOW to HIGH for the update to take effect.
NXP Semiconductors
T able 18. System PLL clock source select register (SYSPLLCLKSEL, address 0x4004 8040)
BitSymbolValueDescriptionReset
1:0SELSystem PLL clock source0x00
31:2--Reserved0x00
3.5.12 System PLL clock source update enable register
This register updates the clock source of the system PLL with the new input clock after the
SYSPLLCLKSEL register has been written to. In order for the update to take effect, first
write a zero to the SYSPLLUEN register and then write a one to SYSPLLUEN.
Remark: When switching clock sources, both clocks must be running before the clock
source is updated.
This register selects the clock source for the dedicated USB PLL. The USBPLLCLKUEN
register (see Section 3.5.14
effect.
Remark: When switching clock sources, both clocks must be running before the clock
source is updated in the USBPLLCLKUEN register. For USB operation, the clock source
must be switched from IRC to system oscillator with both the IRC and the system
oscillator running. After the switch, the IRC can be turned off.
T able 20. USB PLL clock source select register (USBPLLCLKSEL, address 0x4004 8048) bit
description
BitSymbolValueDescriptionReset
1:0SELUSB PLL clock source0x00
0x0IRC. The USB PLL clock source must be switched to system
) must be toggled from LOW to HIGH for the update to take
value
oscillator for correct USB operation.
NXP Semiconductors
3.5.14 USB PLL clock source update enable register
This register updates the clock source of the USB PLL with the new input clock after the
USBPLLCLKSEL register has been written to. In order for the update to take effect at the
USB PLL input, first write a zero to the USBPLLUEN register and then write a one to
USBPLLUEN.
Remark: The system oscillator must be selected in the USBPLLCLKSEL register in order
to use the USB PLL, and this register must be toggled to update the USB PLL clock with
the system oscillator.
Remark: When switching clock sources, both clocks must be running before the clock
source is updated.
T able 21. USB PLL clock source update enable register (USBPLLCLKUEN, address 0x4004
BitSymbolValueDescriptionReset value
0ENAEnable USB PLL clock source update0x0
31:1--Reserved0x00
UM10375
Chapter 3: LPC13xx System configuration
804C) bit description
0No change
1Update clock source
3.5.15 Main clock source select register
This register selects the main system clock which can be either any input to the system
PLL, the output from the system PLL (sys_pllclkout), or the watchdog or IRC oscillators
directly. The main system clock clocks the core, the peripherals and memories, and
optionally the USB block.
The MAINCLKUEN register (see Section 3.5.16
the update to take effect.
Remark: When switching clock sources, both clocks must be running before the clock
source is updated.
Table 22. Main clock source select register (MAINCLKSEL, address 0x4004 8070) bit
description
BitSymbolValueDescriptionReset value
1:0SELClock source for main clock0x00
0x0IRC oscillator
0x1Input clock to system PLL
0x2WDT oscillator
0x3System PLL clock out
31:2--Reserved0x00
) must be toggled from LOW to HIGH for
3.5.16 Main clock source update enable register
This register updates the clock source of the main clock with the new input clock after the
MAINCLKSEL register has been written to. In order for the update to take effect, first write
a zero to the MAINCLKUEN register and then write a one to MAINCLKUEN.
This register divides the main clock to provide the system clock to the core, memories,
and the peripherals. The system clock can be shut down completely by setting the DIV
bits to 0x0.
Table 24. System AHB clock divider register (SYSAHBCLKDIV, address 0x4004 8078) bit
BitSymbolDescriptionReset value
7:0DIVSystem AHB clock divider values
31:8-Reserved0x00
UM10375
Chapter 3: LPC13xx System configuration
bit description
0No change
1Update clock source
description
0x01
0: System clock disabled.
1: Divide by 1.
to
255: Divide by 255.
3.5.18 System AHB clock control register
The SYSAHBCLKCTRL register enables the clocks to individual system and peripheral
blocks. The system clock (sys_ahb_clk[0], bit 0 in the SYSAHBCLKCTRL register)
provides the clock for the AHB to APB bridge, the AHB matrix, the ARM Cortex-M3, the
Syscon block, and the PMU. This clock cannot be disabled.
Table 25. System AHB clock control register (SYSAHBCLKCTRL, address 0x4004 8080) bit
description
BitSymbolValueDescriptionReset
0SYSEnables clock for AHB to APB bridge, to the AHB
matrix, to the Cortex-M3 FCLK and HCLK, to the
SysCon, and to the PMU. This bit is read only.
0Reserved
1Enabled
Table 25. System AHB clock control register (SYSAHBCLKCTRL, address 0x4004 8080) bit
BitSymbolValueDescriptionReset
3FLASHREGEnables clock for flash register interface.1
4FLASHARRAYEnables clock for flash array access.1
5I2CEnables clock for I2C.0
6GPIOEnables clock for GPIO.1
7CT16B0Enables clock for 16-bit counter/timer 0.0
8CT16B1Enables clock for 16-bit counter/timer 1.0
9CT32B0Enables clock for 32-bit counter/timer 0.0
10CT32B1Enables clock for 32-bit counter/timer 1.0
11SSPEnables clock for SSP.1
12UARTEnables clock for UART. Note that for the
13ADCEnables clock for ADC.0
14USB_REGEnables clock for USB_REG.1
description
UM10375
Chapter 3: LPC13xx System configuration
…continued
value
0Disabled
1Enabled
0Disabled
1Enabled
0Disabled
1Enabled
0Disabled
1Enabled
0Disabled
1Enabled
0Disabled
1Enabled
0Disabled
1Enabled
0Disabled
1Enabled
0Disabled
1Enabled
0
LPC1311/13/42/43, the UAR T pins must be configured
in the IOCON block before the UART clock can be
enabled. For the LPC1311/01 and LPC1313/01 no
special enabling sequence is required.
0: Disable SSP0_PCLK.
1: Divide by 1.
to
255: Divide by 255.
31:8-Reserved0x00
3.5.20 UART clock divider register
This register configures the UART peripheral clock UART_PCLK. The UART_PCLK can
be shut down by setting the DIV bits to 0x0.
Remark: Note that for the LPC1311/13/42/43, the UART pins must be configured in the
IOCON block before the UART clock can be enabled. For the LPC1311/01 and
LPC1313/01 no special enabling sequence is required.
0: Disable SYSTICK timer clock.
1: Divide by 1.
to
255: Divide by 255.
31:8-Reserved0x00
0x00
3.5.24 USB clock source select register
This register selects the clock source for the USB usb_clk. The clock source can be either
the USB PLL output or the main clock, and the clock can be further divided by the
USBCLKDIV register (see Table 33
The USBCLKUEN register (see Section 3.5.25
the update to take effect.
Remark: When switching clock sources, both clocks must be running before the clock
source is updated. The default clock source for the USB controller is the USB PLL output.
For switching the clock source to the main clock, ensure that the system PLL and the USB
PLL are running to make both clock sources available for switching. The main clock must
be set to 48 MHz and configured with the main PLL and the system oscillator. After the
switch, the USB PLL can be turned off.
Table 31. USB clock source select register (USBCLKSEL, address 0x4004 80C0) bit
BitSymbolValueDescriptionReset
1:0SELUSB clock source0x00
31:2--Reserved0x00
UM10375
Chapter 3: LPC13xx System configuration
description
value
0x0USB PLL out
0x1Main clock
0x2Reserved
0x3Reserved
3.5.25 USB clock source update enable register
This register updates the clock source of the USB with the new input clock after the
USBCLKSEL register has been written to. In order for the update to take effect, first write
a zero to the USBCLKUEN register and then write a one to USBCLKUEN.
Remark: When switching clock sources, both clocks must be running before the clock
source is updated.
T able 32. USB clock source update enable register (USBCLKUEN, address 0x4004 80C4) bit
description
BitSymbolValueDescriptionReset value
0ENAEnable USB clock source update0x0
0No change
1Update clock source
31:1--Reserved0x00
3.5.26 USB clock divider register
This register allows the USB clock usb_clk to be divided to 48 MHz. The usb_clk can be
shut down by setting the DIV bits to 0x0.
Table 33. USB clock divider re gister (USBCLKDIV, address 0x4004 80C8) bit description
BitSymbolDescriptionReset value
7:0DIVUSB clock divider values.
0: Disable USB clock.
1: Divide by 1.
to
255: Divide by 255.