Datasheet

336
12.4.5 Cascade Connection Mode
Cascade connection mode is a function that connects the 16-bit counters of two channels together
to act as a 32-bit counter.
This function operates by using the TPSC2–TPSC0 bits of the TCR register to set the channel 1
counter clock to count by TCNT2 counter overflow/underflow.
Note: When channel 1 is set to phase counting mode, the counter clock settings become
ineffective.
Table 12.6 shows the cascade connection combinations.
Table 12.6 Cascade Connection Combinations
Combination Upper 16 Bits Lower 16 Bits
Channel 1, channel 2 TCNT1 TCNT2
Procedure for Setting Cascade Connection Mode (Figure 12.22):
1. Set the TPSC2–TPSC 0 bits of the channel 1 timer control register (TCR) to B'111 to select
“count by TCNT2 overflow/underflow.”
2. Set the CST bits corresponding to the upper and lower 16 bits in the TSTR to 1 to start the
count operation.
Cascade connection operation
Select cascade connection
Start counting
Cascade connection operation
1
2
Figure 12.22 Procedure for Selecting Cascade Connection Mode