
DocID13284 Rev 2
219/564
UM0404
The general purpose timer units
Note:
The direction control works the same for core timer T3 and for auxiliary timers T2 and T4.
Therefore the pins and bits are named Tx...
Timer 3 output toggle latch
An overflow or underflow of timer T3 will clock the toggle bit T3OTL in control register
T3CON. T3OTL can also be set or reset by software.
Bit T3OE (Alternate Output Function Enable) in register T3CON enables the state of T3OTL
to be an alternate function of the external output pin T3OUT/P3.3. For that purpose, a ‘1’
must be written into port data latch P3.3 and pin T3OUT/P3.3 must be configured as output
by setting direction control bit DP3.3 to ‘1’. If T3OE = ‘1’, pin T3OUT then outputs the state
of T3OTL. If T3OE = ‘0’, pin T3OUT can be used as general purpose I/O pin.
In addition, T3OTL can be used in conjunction with the timer over/underflows as an input for
the counter function or as a trigger source for the reload function of the auxiliary timers T2
and T4.
For this purpose, the state of T3OTL does not have to be available at pin T3OUT, because
an internal connection is provided for this option.
Timer 3 in timer mode
Timer mode for the core timer T3 is selected by setting bit-field T3M in register T3CON to
‘000b’. In this mode, T3 is clocked with the internal system clock (CPU clock) divided by a
programmable pre-scaler, which is selected by bit-field T3I.
The input frequency f
T3
for timer T3 and its resolution
r
T3
are scaled linearly with lower clock
frequencies f
CPU
, as can be seen from the following formula:
Figure 77. Core timer T3 in timer mode
f
T3
=
f
CPU
8 x 2
(T3I)
r
T3
[
μ
s] =
f
CPU
[MHz]
8 x 2
(T3I)
X
T3l
CPU
Clock
T3R
MUX
T3UDE
Core Timer T3
T3IR
Interrupt
Request
T3OTL
T3OE
T3OUT
Up/Down
XOR
1
0
T3UD
T3EUD
P3.4
P3.3