CHAPTER 7 8-BIT TIMER
(3) Operation as square-wave output with 16-bit resolution
Square waves of any frequency can be output at an interval specified by the count value preset in CR50 and
CR60.
To operate as a square-wave output with 16-bit resolution, settings must be made in the following sequence.
<1> Disable operation of TM50 and TM60 (TCE50 = 0, TCE60 = 0).
<2> Disable output of TO50 and TO60 (TOE50 = 0, TOE60 = 0).
<3> Set a count clock for timer 60.
<4> Select either TO60 or TO61 as the timer output pin.
If TO60 is selected: Set P32 to the output mode (PM32 = 0), set the P32 output latch to 0, and set
TO60 to output enable (TO60 = 1). (Use of TO50 is prohibited.)
If TO61 is selected: Set P33 to the output mode (PM33 = 0), set the P33 output latch to 0, and set
TO61 to output enable (TOE61 = 1). (Use of TO50 is prohibited.)
<5> Set count values in CR50 and CR60.
<6> Enable the operation of TM60 (TCE60 = 1Note).
Note Start and clear of the timer in the 16-bit timer counter mode are controlled by TCE60 (the value of
TCE50 is invalid).
When the count values of TM50 and TM60 simultaneously match the values set in CR50 and CR60
respectively, the TO60 pin output will be inverted. Through application of this mechanism, square waves of
any frequency can be output. As soon as a match occurs, TM50 and TM60 are cleared to 00H and counting
continues. At the same time, an interrupt request signal (INTTM60) is generated (INTTM50 is not
generated).
The square-wave output is cleared to 0 by setting TCE60 to 0.
Table 7-8 shows the square wave output range, and Figure 7-18 shows timing of square wave output.
Cautions 1. Be sure to stop the timer operation before overwriting the count clock with different
data.
2. In the 16-bit timer counter mode, TO50 cannot be used. Be sure to set TOE50 = 0 to
disable TO50 output.
Remark Items in parentheses are for when the TO61 pin is selected for timer output.
Table 7-8. Square-Wave Output Range with 16-Bit Resolution (During fX = 5.0 MHz Operation)
TCL602 TCL601 TCL600
Minimum Pulse Width
1/fX (0.2 µs)
Maximum Pulse Width
216/fX (13.1 ms)
Resolution
1/fX (0.2 µs)
0
0
0
0
1
1
0
0
1
1
0
0
0
1
0
1
0
1
217/fX (26.2 ms)
2/fX (0.4 µs)
2/fX (0.4 µs)
fTMI input cycle
fTMI/2 input cycle
fTMI/22 input cycle
fTMI/23 input cycle
fTMI input cycle × 216
fTMI/2 input cycle × 216
fTMI/22 input cycle × 216
fTMI/23 input cycle × 216
fTMI input cycle
fTMI/2 input cycle
fTMI/22 input cycle
fTMI/23 input cycle
Remark fX: Main system clock oscillation frequency
158
User’s Manual U15075EJ1V0UM00