Specifications
62
3706C–MICRO–2/11
AT89LP3240/6440
12.2 Capture Mode
In the Capture mode, Timer 2 is a fixed 16-bit timer or counter that counts up from MIN to MAX.
An overflow from MAX to MIN sets bit TF2 in T2CON. If EXEN2 = 1, a 1-to-0 transition at exter-
nal input T2EX also causes the current value in TH2 and TL2 to be captured into RCAP2H and
RCAP2L, respectively. In addition, the transition at T2EX causes bit EXF2 in T2CON to be set.
The EXF2 and TF2 bits can generate an interrupt. C
apture mode is illustrated in Figure 12-1.
The Timer 2 overflow rate in Capture mode is given by the following equation:
PHS [2-0] CCA Phase Mode. PWM channels may be grouped by 2, 3 or 4 such that only one channel in a group produces a pulse
in any one period. The PHS[2-0] bits may only be written when the timer is not active, i.e. TR2 = 0.
PHS2
PHS1 PHS0 Phase Mode
000Disabled, all channels active
0012-phase output on channels A & B
0103-phase output on channels A, B & C
0114-phase output on channels A, B, C & D
100Dual 2-phase output on channels A & B and C & D
101reserved
110reserved
111reserved
T2CM
[1-0]
Timer 2 Count Mode.
T2CM1
T2CM0 Count Mode
00Standard Timer 2 (up count: )
0 1 Clear on RCAP compare (up count: )
10Dual-slope with single update (up-down count: )
11Dual-slope with double update (up-down count: )
T2OE Timer 2 Output Enable. When T2OE = 1 and C/T
2 = 0, the T2 pin will toggle after every Timer 2 overflow.
DCEN Timer 2 Down Count Enable. When Timer 2 operates in Auto-Reload mode and EXEN2 = 1, setting DCEN = 1 will cause
Timer 2 to count up or down depending on the state of T2EX.
Symbol Function
BOTTOM MAX→
MIN TOP→
MIN TOP MIN→→
MIN TOP MIN→→
Capture Mode: Time-out Period
65536
Oscillator Frequency
-------------------------------------------------------
TPS 1+()×=