MS51
Nov. 28, 2019
Page
298
of 491
Rev 1.00
MS51
32K
SE
RIES
TE
CHNICAL RE
F
EREN
CE MA
N
UAL
Auto-Reload Mode
6.5.2.2
The Timer 2 is configured as auto-reload mode by clearing
CM/RL2
̅̅̅̅̅̅
. In this mode RCMP2H and
RCMP2L registers store the reload value. The contents in RCMP2H and RCMP2L transfer into TH2
and TL2 once the auto-reload event occurs if setting LDEN bit. The event can be the Timer 2 overflow
or one of the triggering event on any of enabled input capture channel depending on the LDTS[1:0]
(T2MOD[1:0]) selection. Note that once CAPCR (T2MOD.3) is set, an input capture event only clears
TH2 and TL2 without reloading RCMP2H and RCMP2L contents.
TF2
Timer 2 Interrupt
Pre-scalar
F
SYS
RCMP2H
T2DIV[2:0]
(T2MOD[6:4])
RCMP2L
TH2
TL2
00
01
10
11
CAPF0
CAPF1
CAPF2
LDEN
[1]
(T2MOD.7)
LDTS[1:0]
(T2MOD[1:0])
TR2
(T2CON.2)
Timer 2 Module
C0H
C0L
Noise
Filter
ENF0
(CAPCON2.4)
or
[00]
[01]
[10]
CAP0LS[1:0]
(CAPCON1[1:0])
CAPEN0
(CAPCON0.4)
CAPF0
Input Capture 0 Module
Input Capture 1 Module
Input Capture 2 Module
In
p
u
t
C
a
p
tu
re
F
la
g
s
C
A
P
F
[2
:0
]
CAPCR
[1]
(T2MOD.3)
CAPF0
CAPF1
CAPF2
Clear Timer 2
[1]
Once CAPCR and LDEN are both set, an input capture event only clears TH2 and TL2 without reloading RCMP2H and RCMP2L contents.
Input Capture Interrupt
CAPF0
CAPF1
CAPF2
CAP0
CAP1
CAP2
0000
0001
0010
0011
0100
0101
0110
0111
P1.5/IC7
P0.5/IC6
P0.3/IC5
P0.1/IC4
P0.0/IC3
P1.0/IC2
P1.1/IC1
P1.2/IC0
1000
P0.4/IC3
Figure 6.5-6 Timer 2 Auto-Reload Mode and Input Capture Module Functional Block Diagram