• Updated Table 200 “USBD_API_INIT_PARAM class structure” with:
Parameters:
a. hUsb = Handle to the USB device stack.
Returns:
The call back should return ErrorCode_t type to indicate success or error condition.
• Updated Table 208 “USBD_HW_API class structure”:
Added GetMemSize to the text: This function is called by application layer before calling
pUsbApi->hw->
Added Parameters:
– hUsb = Handle to the USB device stack.
– EPNum = Endpoint number corresponding to the event as per USB specification. ie.
An EP1_IN isrepresented by 0x81 number. For device events set this param to 0x0.
– event = Type of endpoint event. See USBD_EVENT_T for more details.
– enable = 1 - enable event, 0 - disable event.Returns:Returns ErrorCode_t type to
indicate success or error condition.Return values:1. LPC_OK(0) = - On success2.
ERR_USBD_INVALID_REQ(0x00040001) = - Invalid event type.
• Added on-chip local RAM to Section 20.8.8 “RAM used by ISP command handler”,
Section 20.8.9 “RAM used by IAP command handler”
commands”
• Deleted: The boot sector can not be prepared by this command from Section 20.14.1
“Prepare sector(s) for write operation”, Table 384 “IAP Copy RAM to flash command”,
and Table 385 “IAP Erase Sector(s) command”.
5.420161007Modifications:
• Added text after Table 227 “Endpoint commands”: For EP0 transfers, the hardware will
do auto handshake as long as the ACTIVE bit is set in EP0_IN/OUT command list.
Unlike other endpoints, the hardware will not clear the ACTIVE bit after transfer is done.
Thus, the software should manually clear the bit whenever it receives new setup packet
and set it only after it has queued the data for control transfer.
5.320140611Modifications:
• I/O Handler interrupt added in T able 59 “Connection of interrupt sources to the Vectored
Interrupt Controller”.
• NVIC register description added. See Section 6.5.
• Use of IAP mode with power profiles clarified. Use power profiles in default mode when
executing IAP commands. See Section 20.14 “IAP commands” and Section 5.3.
• Section 5.3 added to clarify use of power profiles.
• Watchdog interrupt flag polarity corrected: This flag is cleared by writing a 1 to the
WDINT bit in the MOD register (Section 17.8.1 “Watchdog mode register”).
• Figure 69 “Boot process flowchart” corrected.
• T able 15 “Internal resonant crystal control register (IRCCTRL, address 0x4004 8028) bit
description” added.
• Remark added to Section 3.9.4.3 “Wake-up from Deep-sleep mode” and
Section 3.9.5.3 “Wake-up from Power-down mode”: After wake-up, reprogram the clock
source for the main clocks.
• Pin description tables for RESET/PIO0_0 updated: In deep power-down mode, this pin
must be pulled HIGH externally. The RESET pin can be left unconnected or be used as
a GPIO pin if an external RESET function is not needed. See Chapter 8
“LPC1 1U3x/2x/1x Pin configuration”.
• Pin description notes relating to open-drain I2C-bus pins updated for clarity. Chapter 8
“LPC1 1U3x/2x/1x Pin configuration”.
• Pin description of the WAKEUP pin updated for clarity. Chapter 8 “LPC11U3x/2x/1x Pin
configuration”.
5.120131220Modifications:
• Reset value of the SYSAHBCLKCTRL register corrected. See Table 5.
• Reserved function added to IOCON pin configuration registers PIO0_8 and PIO0_9.
See Table 69 and Table 70.
• Changed title to “LPC11U3x/2x/1x User manual”.
520131120Modifications:
• Table 121 “GPIO pins available” corrected.
• Table 343 “ISP entry pins for different boot loader versions” added.
• Bit description of the SLEEPDEEP bit corrected in Table 53 “Power control register
(PCON, address 0x4003 8000) bit description”.
• Part LPC11U37HFBD64/401 added.
• API pointer structure updated in Figure 73, Figure 10, and Figure 19.
• Power Profiles API pointer definitions corrected. See Section 5.4.
Chapter 1: LPC11U3x/2x/1x Introductory information
Rev. 5.5 — 21 December 2016User manual
The LPC11U3x/2x/1x are an ARM Cortex-M0 based, low-cost 32-bit MCU family,
designed for 8/16-bit microcontroller applications, of fering performance, low power , simple
instruction set and memory5 addressing together with reduced code size compared to
existing 8/16-bit architectures.
The LPC11U3x/2x/1x operate at CPU frequencies of up to 50 MHz. Equipped with a
highly flexible and configurable full-speed USB 2.0 device controller, the LPC1 1U3x/2x/1x
bring unparalleled design flexibility and seamless integration to today's demanding
connectivity solutions.
1.2 Features
The peripheral complement of the LPC11U3x/2x/1x includes up to 32 kB of flash memory,
up to 8 kB of SRAM data memory, one Fast-mode Plus I
RS-485/EIA-485 USART with support for synchronous mode and smart card interface,
two SSP interfaces, four general purpose counter/timers, a 10-bit ADC, and up to 54
general purpose I/O pins.
The I/O Handler is a software library-supported hardware engine that can be used to add
performance, connectivity and flexibility to system designs. It is available on the
LPC11U37HFBD64/401. The I/O Handler can emulate serial interfaces such as UART,
I2C, and I2S with no or very low additional CPU load and can off-load the CPU by
performing processing-intensive functions like DMA transfers in hardware. Software
libraries for multiple I/O handler applications are available on http://www.LPCware.com
See Section 25.2 “References”
parts.
for additional documentation related to the LPC11Uxx
2
C-bus interface, one
.
• System:
– ARM Cortex-M0 processor, running at frequencies of up to 50 MHz.
– ARM Cortex -M 0 bu ilt- in Ne ste d Vectored Interrupt Controller (NVIC).
– Non Maskable Interrupt (NMI) input selectable from several input sources.
– System tick timer.
• Memory:
– Up to 32 kB on-chip flash program memory.
– LPC11U3x only: Up to 128 kB on-chip flash program memory with sector (4 kB)
and page erase (256 byte) access.
– In-System Programming (ISP) and In-Application Programming (IAP) via on-chip
bootloader software.
– Total SRAM
LPC1 1U1x: up to 6 kB (4 kB main SRAM and 2 kB USB SRAM).
LPC11U2x: up to 10 kB (8 kB main SRAM and 2 kB USB SRAM).
• I/O Handler for hardware emulation of serial interfaces, DMA, and other functionality;
• Serial interfaces:
• Clock generation:
UM10462
Chapter 1: LPC1 1U3x/2x/1x Introductory information
LPC11U3x: up to 12 kB (8 kB main SRAM0, 2 kB SRAM1, 2 kB USB SRAM).
– 16 kB boot ROM.
– LPC11U2x/3x only: Up to 4 kB on-chip EEPROM data memory; byte erasable and
byte programmable; on-chip API supp ort.
– Power profiles.
– 32-bit integer division routines.
– LPC11U2x/3x only: ROM-based USB drivers. Flash updates via USB supported.
Supports Human-Interface Device (HID) class, Mass S torage Device Class (MSC),
and Communication Device Class (CDC).
– LPC11U2x/3x only: IAP EEPROM drivers.
– Standard JTAG test interface for BSDL.
– Serial Wire Debug.
– Up to 54 General Purpose I/O (GPIO) pins with configurable pull-up/pull-down
resistors, repeater mode, and open-drain mode.
– Up to eight GPIO pins can be selected as edge and level sensitive interrupt
sources.
– Two GPIO grouped interrupt modules enables an interrupt based on a
programmable pattern of input states of a group of GPIO pins.
– High-current source output driver (20 mA) on one pin (P0_7).
– High-current sink driver (20 mA) on true open-drain pins (P0_4 and P0_5).
– Four general purpose counter/timers with a total of 8 capture inputs and 13 match
outputs.
– Programmable windowed WatchDog Timer (WDT) with a dedicated, internal
low-power WatchDog Oscillator (WDO).
– 10-bit ADC with input multiplexing among eight pins.
supported through software libraries. (LPC11U37HFBD64/401 only.)
– USB 2.0 full-speed device controller.
– USART with fractional baud rate generation, internal FIFO, a full modem control
handshake interface, and support for RS-485/9-bit mode and synchron ous mode.
USART supports an asynchronous smart card interface (ISO 7816-3).
– Two SSP interfaces with FIFO and multi-protocol capabilities.
2
C-bus interface supporting the full I2C-bus specification and Fast-mode Plus with
– I
a data rate of up to 1 Mbit/s with multiple address recognition and monitor mode.
– Crystal Oscillator with an operating range of 1 MHz to 25 MHz (system oscillator).
• Available as LQFP64, LQFP48, TFBGA48 packages, and as HVQFN33 in two
• Pin-compatible to the ARM Cortex-M3 based LPC134x series.
UM10462
Chapter 1: LPC1 1U3x/2x/1x Introductory information
– 12 MHz Internal high-frequency RC oscillator (IRC) that can optionally be used as
a system clock.
– Internal low-power, low-frequency WatchDog Oscillator (WDO) with programmable
frequency output.
– PLL allows CPU operation up to the maximum CPU rate with the system oscillator
or the IRC as clock sources.
– A second, dedicated PLL is provided for USB.
– Clock output function with divider that can reflect the crystal oscillator, the main
clock, the IRC, or the watchdog oscillator.
– Four reduced power modes: Sleep, Deep-sleep, Power-down, and Deep
power-down.
– Power profiles residing in boot ROM allow optimized performance and minimized
power consumption for any given application through one simple function call.
– Processor wake-up from Deep-sleep and Power-down modes via reset, select able
GPIO pins, watchdog interrupt, BOD interrupt, or USB port activity.
– Processor wake-up from Deep power-down mode using one special function pin.
– Integrated PMU (Power Management Unit) to minimize power consumption dur ing
Sleep, Deep-sleep, Power-down, and Deep power-down modes.
– Power-On Reset (POR).
– Brownout detect with four separate thresholds for interrupt and forced reset.
package sizes: 5 x 5 x 0.85 mm and 7 x 7 x 0.85 mm.
1.3 Ordering information
Table 1.Ordering information
Type numberPackage
LPC11U12FHN33/201HVQFN33 plastic thermal enhanced very thin quad flat package; no leads; 33
The LPC11U3x/2x/1x incorporates several distinct memory regions, shown in the
following figures. Figure 4
user program viewpoint following reset.
The AHB peripheral area is 2 MB in size and is divided to allow for up to 128 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.
UM10462
Chapter 2: LPC11U3x/2x/1x Memory mapping
shows the overall map of the entire address space from the
The system control block is identical for all LPC11U3x/2x/1x parts.
The following register bit is available on LPC11U3x/501 and LPC11U37H only and is
reserved otherwise: SYSAHBCLKCTRL register bit RAM1 (bit 26) (Table 24Remark: For part LPC11U37H, enable the SRAM1 clock in the SYSAHBCLKCTRL
(Table 24
The DEVICE_ID register contains the device id numbers for the LPC11U1x and
LPC11U2x parts. For LPC11U3x parts, see the ISP/IAP Read Part Id command
(Table 376
3.2 Introduction
) register for running the I/O Handler software library code.
).
).
The system configuration block controls oscillators, some aspects of the power
management, and the clock generation of the LP C11U3x/2x/1x. Also included in this block
is a register for remapping flash, SRAM, and ROM memory areas.
3.3 Pin description
Table 4 shows pins that are assoc iated with system control block functions .
Table 4.Pin summary
Pin namePin
CLKOUTOClockout pin
PIO0 and PIO1 pinsIEight pins can be selected as external interrupt
3.4 Clocking and power control
See Figure 7 for an overview of the LPC11U3x/2x/1x Clock Generation Unit (CGU).
The LPC11U3x/2x/1x include three independent oscillators. These are the system
oscillator, the Internal RC oscillator (IRC), and the W atchdog oscillator . Each oscillator can
be used for more than one purpose as required in a particular application.
direction
Pin description
pins from all available GPIO pins (see Table 40
).
Following reset, the LPC11U3x/2x/1x will operate from the Internal RC oscillator until
switched by software. This allows systems to operate without an 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. USART and SSP have individual clock dividers to derive peripheral clocks
from the main clock.
In addition to the system control block registers described in Table 5, the flash access
timing register, which can be re-configured as part the system setup, is described in
Table 6
UM10462
Chapter 3: LPC11U3x/2x/1x System control block
. This register is not part of the system configuration block.
All address offsets not shown in Table 5
and Table 6 are reserved and should not be
written.
Table 5.Register overview: system control block (base address 0x4004 8000)
NameAccess OffsetDescriptionReset valueReset value
The system memory remap register selects whether the exception ve ctors are read from
boot ROM, flash, or SRAM. By default, the flash memory is mapped to address 0x0000
0000. When the MAP bits in the SYSM E MREMAP register are set to 0x0 or 0x1, the boot
ROM or RAM respectively are mapped to the bottom 512 bytes of the memory map
(addresses 0x0000 0000 to 0x0000 0200).
Table 7.System memory remap register (SYSMEMREMAP, address 0x4004 8000) bit
BitSymbolValueDescriptionReset
1:0MAPSystem memory remap. Value 0x3 is reserved.0x2
31:2--Reserved-
3.5.2 Peripheral reset control register
This register allows software to reset specific peripherals. A 0 in an assigned bit in this
register resets the specified peripheral. A 1 negates the reset and allows peripheral
operation.
UM10462
Chapter 3: LPC11U3x/2x/1x System control block
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 SSP and I2C peripherals, write a 1 to this register to
ensure that the reset signals to the SSP and I2C are de-asserted.
Table 8.Peripheral reset control register (PRESETCTRL, address 0x4004 8004) bit
description
BitSymbolValueDescriptionReset
0SSP0_RST_NSSP0 reset control0
0Resets the SSP0 peripheral.
1SSP0 reset de-asserted.
1I2C_RST_NI2C reset control0
0Resets the I2C peripheral.
1I2C reset de-asserted.
This register connects and enables the system PLL and co nfigures the PLL m ultiplier and
divider values. The PLL accepts an input frequency from 10 MHz to 25 MHz from various
clock sources. The input frequency is multiplied to a higher frequency and then divided
down to provide the actual clock used by the CPU, peripherals, and memories. The PLL
can produce a clock up to the maximum allowed for the CPU.
Table 9.Syste m 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.0
31:7--Reserved. Do not write ones to reserved bits.-
3.5.4 System PLL status register
This register is a Read-only register and supplies the PLL lock status (see
Section 3.10.1
Table 10.System PLL status register (SYSPLLSTAT, address 0x4004 800C) bit description
BitSymbolValueDescriptionReset
0LOCKPLL lock status0
31:1--Reserved-
UM10462
Chapter 3: LPC11U3x/2x/1x System control block
value
0
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 19
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 freque ncy (Fclkana) can
be adjusted with the FREQSEL bits between 600 kHz and 4.6 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)) = 9.4 kHz to 2.3 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 oscillator.
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 14.Watchdog oscillator control register (WDTOSCCTRL, address 0x4004 8024) bit
BitSymbolValueDescriptionReset
4:0DIVSELSelect divider for Fclkana.
8:5FREQSELSelect watchdog oscillator analog output frequency
This register is used to trim the on-chip 12 MHz oscillator. The trim value is factory-preset
and written by the boot code on start-up.
Table 15.Internal resonant crystal control register (IRCCTRL, address 0x4004 8028) bit
BitSymbolDescriptionReset value
7:0TRIMTrim value0x80 then flash will
31:8-Reserved0x00
3.5.10 System reset status register
If another reset signal - for example the external RESET pin - remains asserted after the
POR signal is negated, then its bit is set to detected. Write a one to clear the reset.
UM10462
Chapter 3: LPC11U3x/2x/1x System control block
description
reprogram
The reset value given in Table 16
Table 16.System reset status register (SYSRSTSTAT, address 0x4004 8030) bit description
BitSymbolValueDescriptionReset
0PORPOR reset status1
0No POR detected
1POR detected. Writing a one clears this reset.
1EXTRSTExternal reset status1
0No reset event detected.
1Reset detected. Writing a one clears this reset.
2WDTStatus of the Watchdog reset0
0No WDT reset detected
1WDT reset detected. Writing a one clears this reset.
3BODStatus of the Brown-out detect reset0
0No BOD reset detected
1BOD reset detected. Writing a one clears this reset.
4SYSRSTStatus of the software system reset0
0No System reset detected
1System reset detected. Writing a one clears this reset.
31:5--Reserved-
applies to the POR reset.
value
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
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.
This register selects the clock source for the dedicated USB PLL. The USBPLLCLKUEN
register (see Section 3.5.14
effect.
UM10462
Chapter 3: LPC11U3x/2x/1x System control block
0x4004 8044) bit description
0No change
1Update clock source
) must be toggled from LOW to HIGH for the update to take
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 19. 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
oscillator for correct full-speed USB operation. The IRC is
suitable for low-speed USB operation.
0x1System oscillator
0x2Reserved
0x3Reserved
31:2--Reserved0x00
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.
value
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 20. USB PLL clock source update enable register (USBPLLCLKUEN, address 0x4004
BitSymbolValueDescriptionReset value
0ENAEnable USB PLL clock source update0x0
31:1--Reserved0x00
3.5.15 Main clock source select register
This register selects the main system clock, which can be the system PLL (sys_pllclkout),
or the watchdog oscillator, or the IRC oscillator. The main system clock clocks the core,
the peripherals, and the memories.
UM10462
Chapter 3: LPC11U3x/2x/1x System control block
804C) bit description
0No change
1Update clock source
Bit 0 of the MAINCLKUEN register (see Section 3.5.16
the update to take effect.
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 bit 0 of this register, then write a one.
This register controls how the main clock is divided to provide the system clock to the
core, memories, and the peripherals. The system clock can be shut down completely by
setting the DIV field to zero.