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
Содержание mPD789425
Страница 2: ...2 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 6: ...6 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 10: ...10 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 24: ...24 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 36: ...36 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 46: ...46 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 176: ...User s Manual U15075EJ1V0UM00 176 MEMO ...
Страница 196: ...User s Manual U15075EJ1V0UM00 196 MEMO ...
Страница 210: ...User s Manual U15075EJ1V0UM00 210 MEMO ...
Страница 262: ...262 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 278: ...278 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 296: ...296 User s Manual U15075EJ1V0UM00 MEMO ...
Страница 298: ...User s Manual U15075EJ1V0UM00 298 MEMO ...
Страница 316: ...User s Manual U15075EJ1V0UM00 316 MEMO ...