ST10R272L - GENERAL PURPOSE TIMER UNITS
204/320
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 TX in the respective control register TxCON selects the triggering
transition (see table below).
Note
Only state 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, i.e. 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 8 CPU clock cycles before it
changes.
Timer concatenation
Using the toggle bit T3OTL as a clock source for an auxiliary timer in counter mode,
concatenates the core timer T3 with the respective auxiliary timer. Depending on which
transition of T3OTL is selected to clock the auxiliary timer, this concatenation forms a 32-bit
or a 33-bit timer/counter.
•
32-bit timer/counter: If both a positive and a negative transition of T3OTL is used to
clock the auxiliary timer, this timer is clocked on every overflow/underflow of the core
timer T3. Thus, the two timers form a 32-bit timer.
•
33-bit timer/counter: If either a positive or a negative transition of T3OTL is selected to
clock the auxiliary timer, this timer is clocked on every second overflow/underflow of the
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
1 1 0
Negative transition (falling edge) of output toggle latch T3OTL
1 1 1
Any transition (rising or falling edge) of output toggle latch T3OTL
Table 36 GPT1 auxiliary timer (counter mode) input edge selection