
The general purpose timer units
UM0404
DocID13284 Rev 2
tables apply accordingly with one exception: There is no output toggle latch and no alternate
output pin for T2 and T4.
Timers T2 and T4 in counter mode
Counter mode for the auxiliary timers T2 and T4 is selected by setting bit-field TxM in the
respective register TxCON to ‘001b’. In counter mode timers T2 and T4 can be clocked
either by a transition at the respective external input pin TxIN, or by a transition of timer T3’s
output toggle latch T3OTL (see
The event causing an increment or decrement of a timer can be a positive, a negative, or
both a positive and a negative transition at either the respective input pin, or at the toggle
latch T3OTL. Bit-field TxI in the respective control register TxCON selects the triggering
transition (see
).
Note:
Only transitions of T3OTL which are caused by the overflows/underflows of T3 will trigger
the counter function of T2/T4. Modifications of T3OTL via software will NOT trigger the
counter function of T2 / T4.
For counter operation, pin TxIN must be configured as input, the respective direction control
bit must be ‘0’. The maximum input frequency which is allowed in counter mode is f
CPU
/ 8.
To ensure that a transition of the count input signal which is applied to TxIN is correctly
recognized, its level should be held for at least eight CPU clock cycles before it changes.
Figure 84. Auxiliary timer in counter mode
Table 37. GPT1 auxiliary timer (counter mode) input edge selection
T2I / T4I
Triggering edge for counter increment / decrement
X 0 0
None. Counter Tx is disabled
0 0 1
Positive transition (rising edge) on TxIN
0 1 0
Negative transition (falling edge) on TxIN
0 1 1
Any transition (rising or falling edge) on TxIN
1 0 1
Positive transition (rising edge) of output toggle latch T3OTL
Txl
TxR
MUX
TxUDE
Auxiliary Timer Tx
TxIR
Interrupt
Request
Up/Down
XOR
1
0
TxUD
TxEUD
TxIN
x = 2,4
Edge
Select
P3.7,
P3.5
P5.15,
P5.14