0% found this document useful (0 votes)
121 views

Timers in LPC 2148

The document describes the timers in the LPC2148 microcontroller. It discusses the features and applications of the timers, including interval timing, free running timing, and pulse width modulation. It explains the timer registers including the timer counter, prescaler, and match registers. It also describes the different match types, external match pins, and how the timer counter value is compared to the match registers to trigger actions on the pins.

Uploaded by

tj rimes
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views

Timers in LPC 2148

The document describes the timers in the LPC2148 microcontroller. It discusses the features and applications of the timers, including interval timing, free running timing, and pulse width modulation. It explains the timer registers including the timer counter, prescaler, and match registers. It also describes the different match types, external match pins, and how the timer counter value is compared to the match registers to trigger actions on the pins.

Uploaded by

tj rimes
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 24

TIMERS IN LPC 2148

Features

Applications
Interval Timer for Counting internal events
Free running timer
Pulse Width Modulator

Pins for Timers

Timer Register

TC gets incremented by 1 for every PR+1 cycles


PR register specifies the maximum value of PC
PC will be incremented for every single clock cycle until
it reaches PR then it will be RESET
Example

Before 1st clock pulse


TC = 0 ;
PR = 0 ; (has to be initialized by User)
PC = 0 ; (Read Only)
After 1st clock pulse
TC = 1 ;
PR = 0 ; (has to be initialized by User)
PC = 1 ; (Read Only) then again becomes PC = 0;

MATCH TYPES
Internal Match (Action is performed Internally)
External Match (Action is performed Externally i.e., on
Pins)
Match channels and its Registers

CH0
CH1
CH2
CH3

MR0
MR1
MR2
MR3

register
register
register
register

Match Registers (MR0 MR3)


The Match register values are continuously compared to
the Timer Counter value. When the two values are
equal, actions can be triggered automatically. The
action possibilities are to generate an interrupt, reset
the Timer Counter or stop the timer. Actions are
controlled by the settings in the MCR register
Always TC is compared with MR0-MR3 registers
If any match is generated then a particular action can be
performed
Action can be selected by using MCR Register.

Capture Channels and its Registers


CH0 CR0 Register
CH1 CR1 Register
CH2 CR2 Register
CH3 CR3 Register
For any external events on Capture Pins TC register is
stored in respective Capture Channel Register

Capture Control

External Match
External Match Pins
MAT0.0 (2pins): P0.3 and P0.22
MAT0.1 (2pins): P0.5 and P0.27
MAT0.2 (2pins): P0.16 and P0.28
MAT0.3 (1pin): P0.29
MAT1.0 (1pin): P0.12
MAT1.1 (1pin): P0.13
MAT1.2 (2pins): P0.17 and P0.19
MAT1.3 (2pins): P0.18 and P0.20
Whenever TC equals any of match register then an action can be performed
on the above match pins and that action is decided by EMR Register

You might also like