CHAPTER 7 8-BIT TIMER/EVENT COUNTER
User's Manual U11919EJ3V0UM00
112
7.4.3 Operation as square wave output
The 8-bit timer/event counter can generate the output square waves of arbitrary frequency at intervals specified
by the count value set to 8-bit compare register 00 (CR00) in advance.
To operate 8-bit timer/event counter 00 as square wave output, the following settings are required.
<1> Set P50 to output mode (PM50 = 0).
<2> Set 0 for the output latch of P50.
<3> Disable the operation of 8-bit timer counter 00 (TM00) (TCE00 (bit 7 of 8-bit timer mode control register 00
(TMC00)) = 1).
<4> Set a count clock for 8-bit timer/event counter 00 and enable output of TO0 (TOE00 (bit 0 of TMC00) = 1).
<5> Set a count value in CR00.
<6> Enable the operation of TM00 (TCE00 = 1).
When the count value of 8-bit timer counter 00 (TM00) matches the value set in CR00, the TO0/P50/TI0 pin
output will be inverted, respectively. Through application of this mechanism, square waves of any frequency can be
output. As soon as a match occurred, the TM00 value will be cleared to 0 then resume to count, generating an
interrupt request signal (INTTM0).
Setting 0 to the bit 7 in TMC00, that is, TCE00 makes the square-wave output clear to 0.
Table 7-5 lists square wave output range, and Figure 7-6 shows timing of square wave output.
Cautions 1. Before rewriting CR00, stop the timer operation. If CR00 is rewritten while the timer
operation is enabled, the coincidence interrupt request signal may be generated
immediately.
2. If setting the count clock in TMC00 and enabling the operation of TM00 are performed at the
same time with an 8-bit memory manipulation instruction, the error one cycle after the timer
has been started may exceed one clock. To use the 8-bit timer/event counter as a square
wave output, therefore, perform the setting in the above sequence.
Table 7-5. Square Wave Output Range of 8-Bit Timer/Event Counter 00
TCL001
TCL000
Minimum Pulse Width
Maximum Pulse Width
Resolution
0
0
1/f
X
(200 ns)
2
8
/f
X
(51.2
µ
s)
1/f
X
(200 ns)
0
1
2
5
/f
X
(6.4
µ
s)
2
13
/f
X
(1.64 ms)
2
5
/f
X
(6.4
µ
s)
Remarks 1. f
X
: System clock oscillation frequency
2. The parenthesized values apply to operation at f
X
= 5.0 MHz.
www.DataSheet4U.com
Summary of Contents for UPD789026 Series
Page 2: ...User s Manual U11919EJ3V0UM00 2 MEMO www DataSheet4U com...
Page 8: ...User s Manual U11919EJ3V0UM00 8 MEMO www DataSheet4U com...
Page 12: ...User s Manual U11919EJ3V0UM00 12 MEMO www DataSheet4U com...
Page 22: ...User s Manual U11919EJ3V0UM00 22 MEMO www DataSheet4U com...
Page 32: ...User s Manual U11919EJ3V0UM00 32 MEMO www DataSheet4U com...
Page 84: ...User s Manual U11919EJ3V0UM00 84 MEMO www DataSheet4U com...
Page 92: ...User s Manual U11919EJ3V0UM00 92 MEMO www DataSheet4U com...
Page 104: ...User s Manual U11919EJ3V0UM00 104 MEMO www DataSheet4U com...
Page 166: ...User s Manual U11919EJ3V0UM00 166 MEMO www DataSheet4U com...
Page 178: ...User s Manual U11919EJ3V0UM00 178 MEMO www DataSheet4U com...
Page 184: ...User s Manual U11919EJ3V0UM00 184 MEMO www DataSheet4U com...
Page 204: ...User s Manual U11919EJ3V0UM00 204 MEMO www DataSheet4U com...
Page 206: ...User s Manual U11919EJ3V0UM00 206 MEMO www DataSheet4U com...
Page 212: ...User s Manual U11919EJ3V0UM00 212 MEMO www DataSheet4U com...