MC96FM204/FM214
102
April 7, 2016 Ver. 1.8
11.6 Timer 2
11.6.1 Overview
The 16-bit timer 2 consists of multiplexer, timer 2 A data register high/low, timer 2 B data register high/low and
timer 2 control register high/low (T2ADRH, T2ADRL, T2BDRH, T2BDRL, T2CRH, T2CRL).
It has four operating modes:
-
16-bit timer/counter mode
-
16-bit capture mode
-
16-bit PPG output mode (one-shot mode)
-
16-bit PPG output mode (repeat mode)
The timer/counter 2 can be clocked by an internal or an external clock source (EC2). The clock source is
selected by clock selection logic which is controlled by the clock selection bits (T2CK[2:0]).
- TIMER2 clock source: f
X
/1, 2, 4, 8, 64, 512, 2048 and EC2
In the capture mode, by EINT12, the data is captured into input capture data register (T2BDRH/T2BDRL). Timer
2 outputs the comparison result between counter and data register through T2O port in timer/counter mode. Also
Timer 2 outputs PWM wave form through PWM2O port in the PPG mode.
Table 11-7 Timer 2 Operating Modes
T2EN
PFSR17
T2MS[1:0]
T2CK[2:0]
Timer 2
1
1
00
XXX
16 Bit Timer/Counter Mode
1
0
01
XXX
16 Bit Capture Mode
1
1
10
XXX
16 Bit PPG Mode
(one-shot mode)
1
1
11
XXX
16 Bit PPG Mode
(repeat mode)
11.6.2 16-Bit Timer/Counter Mode
The 16-bit timer/counter mode is selected by control register as shown in Figure 11.6.
The 16-bit timer have counter and data register. The counter register is increased by internal or external clock
input. Timer 2 can use the input clock with one of 1, 2, 4, 8, 64, 512 and 2048 prescaler division rates (T2CK[2:0]).
When the value of T2CNTH, T2CNTL and the value of T2ADRH, T2ADRL are identical in Timer 2 respectively, a
match signal is generated and the interrupt of Timer 2 occurs. The T2CNTH, T2CNTL value is automatically
cleared by match signal. It can be also cleared by software (T2CC).
The external clock (EC2) counts up the timer at the rising edge. If the EC2 is selected as a clock source by
T2CK[2:0], EC2 port should be set to the input port by P16IO bit.
Summary of Contents for MC96FM204
Page 17: ...MC96FM204 FM214 April 7 2016 Ver 1 8 17 4 Package Diagram Figure 4 1 20 Pin SOP Package ...
Page 18: ...MC96FM204 FM214 18 April 7 2016 Ver 1 8 Figure 4 2 20 Pin TSSOP Package ...
Page 19: ...MC96FM204 FM214 April 7 2016 Ver 1 8 19 Figure 4 3 16 Pin SOP Package ...
Page 20: ...MC96FM204 FM214 20 April 7 2016 Ver 1 8 Figure 4 4 16 Pin TSSOP Package ...