Operation As Square Wave Output - NEC UPD789026 Series User Manual

8-bit single-chip
Table of Contents

Advertisement

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.
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.
TCL001
TCL000
www.DataSheet4U.com
0
0
Remarks 1. f
: System clock oscillation frequency
X
2. The parenthesized values apply to operation at f
112
CHAPTER 7 8-BIT TIMER/EVENT COUNTER
Table 7-5. Square Wave Output Range of 8-Bit Timer/Event Counter 00
Minimum Pulse Width
0
1/f
(200 ns)
X
(6.4 µ s)
5
1
2
/f
X
User's Manual U11919EJ3V0UM00
If CR00 is rewritten while the timer
Maximum Pulse Width
(51.2 µ s)
8
2
/f
X
13
2
/f
(1.64 ms)
X
= 5.0 MHz.
X
Resolution
1/f
(200 ns)
X
(6.4 µ s)
5
2
/f
X

Advertisement

Table of Contents
loading

This manual is also suitable for:

Upd78f9026aUpd789025Upd789022Upd789024Upd789026

Table of Contents