
XC161 Derivatives
Peripheral Units (Vol. 2 of 2)
The General Purpose Timer Units
User’s Manual
14-48
V2.2, 2004-01
GPT_X1, V2.0
GPT2 Capture/Reload Register CAPREL in Capture-And-Reload Mode
Since the reload function and the capture function of register CAPREL can be enabled
individually by bits T5SC and T6SR, the two functions can be enabled simultaneously by
setting both bits. This feature can be used to generate an output frequency that is a
multiple of the input frequency.
Figure 14-31 GPT2 Register CAPREL in Capture-And-Reload Mode
This combined mode can be used to detect consecutive external events which may
occur aperiodically, but where a finer resolution, that means, more ‘ticks’ within the time
between two external events is required.
For this purpose, the time between the external events is measured using timer T5 and
the CAPREL register. Timer T5 runs in timer mode counting up with a frequency of e.g.
f
GPT
/32. The external events are applied to pin CAPIN. When an external event occurs,
Auxiliary
Timer T5
T5IRQ
Up/Down
Clear
T5SC
Capture
CAPREL
Register
0
1
MUX
CT3
CI
CAPIN
T3IN
T3EUD
Count
Clock
T5CC
Capture
Correction
T5CLR
CRIRQ
MCA05412
T6SR
Core Timer T6
Clear
T6CLR
Reload
Up/Down
Count
Clock
Toggle Latch
T6OUT
T6IRQ
T6OUF
to T5
Edge
Select
Edge
Select