CBS 5- Embedded systems and IoT
LPC 214X Family and Timer Unit
The LPC2148 microcontroller is designed by Philips (NXP
Semiconductor) with several in-built features & peripherals
The main features of LPC2148 include the following.
1. The LPC2148 is a 16 bit or 42 bit ARM7 family based microcontroller and
available in a small LQFP64 package.
2. On-chip static RAM is 8 kB - 40 kB, on-chip flash memory is 42 kB - 512
kB, the wide interface is 128 bit, or accelerator allows 60 MHz high-speed
operation.
3. It takes 400 milliseconds time for erasing the data in full chip and 1
millisecond time for 256 bytes of programming.
4. Embedded Trace interfaces and Embedded ICE RT offers real-time
debugging with high-speed tracing of instruction execution and on-chip
Real Monitor software.
5. It has 2 kB of endpoint RAM and USB 2.0 full speed device controller.
Furthermore, this microcontroller offers 8kB on-chip RAM nearby to USB
with DMA.
6. One or two 10-bit ADCs offer 6 or 14 analogs Inputs with low conversion
time as 2.44 |s/ channel. Only 10 bit DAC offers changeable analog output.
7. External event counter/32 bit timers - 2, PWM unit, & watchdog.
8. Low power RTC (real time clock) & 32 kHz clock input.
9. Several serial interfaces like two 16C550 UARTs, two I2C-buses with 400
kbit/s speed.
10. The 5 volts tolerant quick general purpose Input/output pins in a small
LQFP64 package.
11. The incorporated oscillator on the chip will work by an exterior crystal that
ranges from 1 MHz-25 MHz
CBS 5- Embedded systems and IoT
12. The modes for power-conserving mainly comprise idle & power down.
13. For extra power optimization, there are individual enable or disable of
peripheral functions and peripheral CLK scaling.
Timer Unit
The LPC2148 has two functionally identical general-purpose timers :
Timer0 and Timer1.
These both timers are 32-bit along with 32-bit prescaler. Timer allows us
to generate precise time delay.
The heart of timers of the LPC2148 Microcontroller is a 32-bit free running
counter, which is designed to count cycles of the Peripheral Clock (PCLK) or an
external clock, this counter is programmable with 32-bit prescaler.
Timer used in LPC 2147 are as follows :
1. Prescale Counter (PC) : The 32-bit PC is a counter which is incremented
to the value stored in PR (Prescale Register) when value in PR is reached,
The TC (Timer Counter) is incremented and PC is cleared. The PC is
observable and controllable through bus interface.
2. Prescale Register : The 32-bit register which hold the maximum value of
prescale counter after which it reset.
3. Timer Counter (TC) : This is 32-bit Timer Counter which gets
incremented whenever PC Prescale Counter value reaches to its maximum
value as specified in PR.
4. Timer Control Register : Timer Control register used to control the timer
control functions. We'll enable, disable and reset Timer Counter (TC)
through this register
5. Count Control Register (CTCR) : This register selects Timer Counter
Mode. In our example we have used timer mode. This can be done by
setting CTCR to 0x0.