ST10R272L - GENERAL PURPOSE TIMER UNITS
210/320
11.2
Timer block GPT2
From a programmer’s point of view, the GPT2 block is represented by a set of SFRs as
summarized below. Those portions of port and direction registers which are used for
alternate functions by the GPT2 block are shaded.
Timer block GPT2 supports high precision event control with a maximum resolution of 4
CPU clock cycles. It includes the two timers T5 and T6, and the 16-bit capture/reload
register CAPREL. Timer T6 is referred to as the core timer, and T5 is referred to as the
auxiliary timer of GPT2.
Each timer has an alternate input function pin associated with it which serves as the gate
control in gated timer mode, or as the count input in counter mode. The count direction (Up
/ Down) may be programmed via software or may be dynamically altered by a signal at an
external control input pin. An overflow/underflow of T6 is indicated by the output toggle bit
T6OTL whose state may be output on an alternate function port pin. In addition, T6 may be
reloaded with the contents of CAPREL.
The toggle bit also supports the concatenation of T6 with auxiliary timer T5, while
concatenation of T6 with the timers of the CAPCOM units is provided through a direct
connection. Triggered by an external signal, the contents of T5 can be captured into register
CAPREL, and T5 may optionally be cleared. Both timer T6 and T5 can count up or down,
and the current timer value can be read or modified by the CPU in the non-bitaddressable
SFRs T5 and T6.
Figure 82 SFRs and port pins associated with timer block GPT2
ODP3
DP3
P3
P5
T5CON
T6CON
T5IN/P5.13
T6IN/P5.12
CAPIN/P3.2
T5CON
T5
T6
CAPREL
T5IC
T6IC
CRIC
T5
T5IC
DP3
P3
T6
CAPREL
T6IC
CRIC
T6CON
P5
ODP3
Port 3 Open Drain Control Register
Port 3 Direction Control Register
Port 3 Data Register
Port 5 Data Register
GPT2 Timer 5 Control Register
GPT2 Timer 6 Control Register
GPT2 Timer 5 Register
GPT2 Timer 6 Register
GPT2 Capture/Reload Register
GPT2 Timer 5 Interrupt Control Register
GPT2 Timer 6 Interrupt Control Register
GPT2 CAPREL Interrupt Control Register
T5EUD/P5.11
T6EUD/P5.10
T6OUT/P3.1