Operation As Square-Wave Output - NEC 78K0/KB1+ Preliminary User's Manual

8-bit single-chip microcontrollers
Table of Contents

Advertisement

7.4.3 Operation as square-wave output

A square wave with any selected frequency is output at intervals determined by the value preset to 8-bit timer
compare register 50 (CR50).
The TO50 pin output status is inverted at intervals determined by the count value preset to CR50 by setting bit 0
(TOE50) of 8-bit timer mode control register 50 (TMC50) to 1. This enables a square wave with any selected
frequency to be output (duty = 50%).
Setting
<1> Set each register.
• Set the port output latch (P17) and port mode register 1 (PM17) to 0.
• TCL50: Select the count clock.
• CR50:
Compare value
• TMC50: Stop the count operation, select clear & start mode entered on a match of TM50 and CR50.
<2> After TCE50 = 1 is set, the count operation starts.
<3> The timer output F/F is inverted by a match of TM50 and CR50. After INTTM50 is generated, TM50 is
cleared to 00H.
<4> After these settings, the timer output F/F is inverted at the same interval and a square wave is output from
TO50.
The frequency is as follows.
Frequency = 1/2t (N + 1)
(N: 00H to FFH)
Caution Do not write other values to CR50 during operation.
Count clock
TM50 count value
00H
Count start
CR50
Note
TO50
Note The initial value of TO50 output can be set by bits 2 and 3 (LVR50, LVS50) of 8-bit timer mode control
register 50 (TMC50).
CHAPTER 7 8-BIT TIMER/EVENT COUNTER 50
LVS50
LVR50
1
0
High-level output
0
1
Low-level output
Timer output F/F inversion enabled
Timer output enabled
(TMC50 = 00001011B or 00000111B)
Figure 7-9. Square-Wave Output Operation Timing
t
N − 1
01H
02H
N
Preliminary User's Manual U16846EJ1V0UD
Timer Output F/F Status Setting
N
00H
01H
02H
N − 1
N
00H
151

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ypd78f0101hYpd78f0102hYpd78f0103h

Table of Contents