R01UH0823EJ0100 Rev.1.00 Page 685 of 1823
Jul 31, 2019
RX23W Group 25. 16-Bit Timer Pulse Unit (TPUa)
(2) Waveform Output by Compare Match
The TPU can perform low, high, or toggle output from the corresponding output pin using a compare match.
(a) Example of setting procedure for waveform output by compare match
Figure 25.5 shows an example of the setting procedure for waveform output by a compare match.
Figure 25.5 Example of Setting Procedure for Waveform Output by Compare Match
(b) Examples of waveform output operation
Figure 25.6 shows an example of low output/high output.
In this example, TPUm.TCNT has been set as a free-running counter, and settings have been made so that high is output
by compare match A and low is output by compare match B. When the set level and the pin level match, the pin level
does not change.
Figure 25.6 Example of Low-Output/High-Output Operation (n = 3, 4)
Select waveform output mode
Output selection
Set output timing
Start count
[1]
[2]
[3]
<Waveform output>
[1] Select an initial output value (low or high) and a
compare match output value (low, high, or toggle)
by setting TIOR. The set initial value is output to
the TIOCyn pin until the first compare match
occurs (y = A to D; n = 0 to 5).
[2] Set the timing for generating a compare match in
TGRy.
[3] Set the TPU.TSTR.CSTj bit (j = 0 to 5) to 1 to start
the counter operation.
No change No change
No change No change
TCNT value
FFFFh
0000h
TIOCBn
Time
High output
Low output
TIOCAn
TGRB
TGRA