RX610 Group
15. 16-Bit Timer Pulse Unit (TPU)
R01UH0032EJ0120 Rev.1.20
Page 496 of 1006
Feb 20, 2013
15.3.4
Cascaded Operation
In cascaded operation, two 16-bit counters for different channels are used together as a 32-bit counter.
In the case of unit 0, this function works by counting the TPU1 (TPU4) counter clock at overflow/underflow of
TPU2.TCNT (TPU5.TCNT) as set by the TPSC[2:0] bits in TPU1.TCR (TPSC[2:0] bits in TPU4.TCR).
In the case of unit 1, this function works by counting the TPU7 (TPU10) counter clock at overflow/underflow of
TPU8.TCNT (TPU11.TCNT) as set by the TPSC[2:0] bits in TPU7.TCR (TPSC[2:0] bits in TPU10.TCR).
Underflow occurs only when the lower 16-bit TPUm.TCNT is in phase counting mode.
Table 15.24 lists the register combinations used in cascaded operation.
Note: When phase counting mode is set for TPU1 or TPU4 (TPU7 or TPU10), the counter clock setting is invalid and
the counter operates independently in phase counting mode.
Table 15.24 Cascaded Combinations
Unit
Combination
Upper 16 Bits
Lower 16 Bits
0
TPU1 and TPU 2
TPU1.TCNT
TPU2.TCNT
TPU 4 and TPU 5
TPU4.TCNT
TPU5.TCNT
1
TPU 7 and TPU 8
TPU7.TCNT
TPU8.TCNT
TPU 10 and TPU 11
TPU10.TCNT
TPU11.TCNT
(1)
Example of Cascaded Operation Setting Procedure
Figure 15.18 shows an example of the setting procedure for cascaded operation.
Set cascading
Cascaded operation
<Cascaded operation>
[1]
[2]
Start counting
Set the TPSC[2:0] bits in TCR of TPU1
(TPU4) to 111b to select TPU2.TCNT
(TPU5.TCNT) overflow/underflow counting.
[1]
Set the CSTj bit in TSTRy for the upper
and lower channels to 1 to start count
operation (y = A, B, j = 0 to 5).
[2]
Figure 15.18 Cascaded Operation Setting Procedure