English
Language : 

XC161 Datasheet, PDF (63/419 Pages) Infineon Technologies AG – 16-Bit Single-Chip Microcontroller with C166SV2 Core Volume 2 (of 2): Peripheral Units
XC161 Derivatives
Peripheral Units (Vol. 2 of 2)
The General Purpose Timer Units
the contents of timer T5 are latched into register CAPREL and timer T5 is cleared
(T5CLR = 1). Thus, register CAPREL always contains the correct time between two
events, measured in timer T5 increments. Timer T6, which runs in timer mode counting
down with a frequency of e.g. fGPT/4, uses the value in register CAPREL to perform a
reload on underflow. This means, the value in register CAPREL represents the time
between two underflows of timer T6, now measured in timer T6 increments. Since (in this
example) timer T6 runs 8 times faster than timer T5, it will underflow 8 times within the
time between two external events. Thus, the underflow signal of timer T6 generates
8 ‘ticks’. Upon each underflow, the interrupt request line T6IRQ will be activated and bit
T6OTL will be toggled. The state of T6OTL may be output on pin T6OUT. This signal has
8 times more transitions than the signal which is applied to pin CAPIN.
Note: The underflow signal of Timer T6 can furthermore be used to clock one or more of
the timers of the CAPCOM units, which gives the user the possibility to set
compare events based on a finer resolution than that of the external events. This
connection is accomplished via signal T6OUF.
Capture Correction
A certain deviation of the output frequency is generated by the fact that timer T5 will
count actual time units (e.g. T5 running at 1 MHz will count up to the value 64H/100D for
a 10 kHz input signal), while T6OTL will only toggle upon an underflow of T6 (i.e. the
transition from 0000H to FFFFH). In the above mentioned example, T6 would count down
from 64H, so the underflow would occur after 101 timing ticks of T6. The actual output
frequency then is 79.2 kHz, instead of the expected 80 kHz.
This deviation can be compensated for by activating the Capture Correction (T5CC = 1).
If capture correction is active, the contents of T5 are decremented by 1 before being
captured. The described deviation is eliminated (in the example, T5 would count up to
the value 64H/100D, but the CAPREL register will capture the decremented value
63H/99D, T6 would count exactly 100 ticks, and the output frequency is 80 kHz).
User’s Manual
GPT_X1, V2.0
14-49
V2.2, 2004-01