CHAPTER 7 8-BIT TIMER
User’s Manual U15075EJ1V0UM00
151
(3)
Operation as square-wave output with 8-bit resolution
Square waves of any frequency can be output at an interval specified by the value preset in 8-bit compare
register n0 (CRn0).
To operate timer n0 for square-wave output, settings must be made in the following sequence.
<1> When using timer 50, set P31 to output mode (PM31 = 0).
When using timer 60, set P32 to output mode (PM32 = 0) or set P33 to output mode (PM33 = 0) (When
TO61 is selected as timer output).
<2> Set the output latches of P31, P32, and P33 to 0.
<3> Disable operation of timer counter n0 (TMn0) (TCEn0 = 0).
<4> Set a count clock for timer n0 and enable output of TOn0 (TOEn0 = 1)
Note
.
<5> Set a count value in CRn0.
<6> Enable the operation of TMn0 (TCEn0 = 1).
When the count value of TMn0 matches the value set in CRn0, the TOn0 pin output will be inverted.
Through application of this mechanism, square waves of any frequency can be output. As soon as a match
occurs, TMn0 is cleared to 00H and continues counting. At the same time, an interrupt request signal
(INTTMn0) is generated.
The square-wave output is cleared to 0 by setting TCEn0 to 0.
Tables 7-5 and 7-6 show the square-wave output range, and Figure 7-15 shows the timing of square-wave
output.
Note
In the case of timer 60, either TO60 or TO61 can be selected as the timer output pin. If TO61 is
selected, set TOE61 = 1.
Caution
Be sure to stop the timer operation before overwriting the count clock with different data.
Remark
n = 5, 6
Table 7-5. Square-Wave Output Range of Timer 50 (During f
X
= 5.0 MHz Operation)
TCL502
TCL501
TCL500
Minimum Pulse Width
Maximum Pulse Width
Resolution
0
0
0
1/f
X
(0.2
µ
s)
2
8
/f
X
(51.2
µ
s)
1/f
X
(0.2
µ
s)
0
0
1
2
3
/f
X
(1.6
µ
s)
2
11
/f
X
(409.6
µ
s)
2
3
/f
X
(1.6
µ
s)
0
1
0
2
7
/f
X
(25.6
µ
s)
2
15
/f
X
(6.55 ms)
2
7
/f
X
(25.6
µ
s)
0
1
1
1/f
XT
(30.5
µ
s)
2
8
/f
XT
(7.81 ms)
1/f
XT
(30.5
µ
s)
1
0
0
Input cycle of timer 60 match
signal
Input cycle of timer 60 match
signal
×
8
Input cycle of timer 60 match
signal
1
0
1
Input cycle of timer 60 output
Input cycle of timer 60 output
×
8
Input cycle of timer 60
Remarks 1. f
X
: Main system clock oscillation frequency
2. f
XT
: Subsystem clock oscillation frequency
Summary of Contents for mPD789425
Page 2: ...2 User s Manual U15075EJ1V0UM00 MEMO ...
Page 6: ...6 User s Manual U15075EJ1V0UM00 MEMO ...
Page 10: ...10 User s Manual U15075EJ1V0UM00 MEMO ...
Page 24: ...24 User s Manual U15075EJ1V0UM00 MEMO ...
Page 36: ...36 User s Manual U15075EJ1V0UM00 MEMO ...
Page 46: ...46 User s Manual U15075EJ1V0UM00 MEMO ...
Page 176: ...User s Manual U15075EJ1V0UM00 176 MEMO ...
Page 196: ...User s Manual U15075EJ1V0UM00 196 MEMO ...
Page 210: ...User s Manual U15075EJ1V0UM00 210 MEMO ...
Page 262: ...262 User s Manual U15075EJ1V0UM00 MEMO ...
Page 278: ...278 User s Manual U15075EJ1V0UM00 MEMO ...
Page 296: ...296 User s Manual U15075EJ1V0UM00 MEMO ...
Page 298: ...User s Manual U15075EJ1V0UM00 298 MEMO ...