LPC214x Architecture - Peripherals and Programming
LPC214x Architecture - Peripherals and Programming
Programming
Shashidhara H S
Agenda
• Features of LPC214x Series
• Memory Map
• GPIO
• Timers
• PWM
• UART
LPC241x
• 16/32 bit ARM7TDMI-S core
• 10 bit DAC
• 2 32-bit timer/counters
• 2 PLLs
Processor Organisation
Processor Organisation
Memory Map
Memory Map
Memory Map
• Core has 32 address lines, hence 4GB addressing capability
• Each peripheral may have many registers and thus has many
addresses (all within 4GB block)
• One PLL is used to generate CCLK. Accepts an input frq in the range
10-25MHz and multiplies to get 10-60MHz required by core
• VPB divider
• Power-down mode
• Processor states, registers, SRAM values and chip pin signals are preserved
Internal Bus
• Fastest - ARM Local bus: connects core to memory as
well as high-speed GPIO
Bus Structure
Peripherals
• GPIO
• Example:
Example 2
• Write pin select register configuration to select P0.0 as GPIO,
P0.1 as RxD, P0.2 as Timer) capture input and P0.14 as
SDA(I2C)
• input/output
• Timer vs Counters
• MR0-3 - one of them can be used to declare count. TC is incremented till it matches with MR
Frequency Calculation
Solution:
Assume CCLK = 50 MHz, So, PCLK = 12.5MHz and 0.08 micro secs
Duty cycle:
(1001)
• DLL and DLM hold divisor value (DLM - Upper 8 bits, DLL
- lower 8 bits, so DLL has 0x01 as starting value)
Registers of UART
• Transmit Holding Register (U0THR and U1THR) - contains character to be
transmitted one byte at a time
• Line Control Register (U0LCR and U1LCR) - used to set format of data to
be transmitted
• Bit 0,1:11(8 bit data), bit 2: 0 for stop bit, bit 7:Divisor Latch Access Bit
(DLAB) should be set to enable latch. (0x83)
• Line Status Register(U0LSR and U1LSR) - status of TxD and RxD blocks