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

8-bit single-chip microcontrollers
Table of Contents

Advertisement

6.4.5 Square-wave output operation

Setting
The basic operation setting procedure is as follows.
<1> Set the count clock by using the PRM00 register.
<2> Set the CRC00 register (see Figure 6-29 for the set value).
<3> Set the TOC00 register (see Figure 6-29 for the set value).
<4> Set any value to the CR000 register (0000H cannot be set).
<5> Set the TMC00 register to start the operation (see Figure 6-29 for the set value).
Caution CR000 cannot be rewritten during TM00 operation.
Remarks 1. For the setting of the TO00 pin, see 6.3 (5) Port mode register 0 (PM0).
2. For how to enable the INTTM000 interrupt, see CHAPTER 14 INTERRUPT FUNCTIONS.
A square wave with any selected frequency can be output at intervals determined by the count value preset to 16-
bit timer capture/compare register 000 (CR000).
The TO00 pin output status is reversed at intervals determined by the count value preset to CR000 +1 by setting
bit 0 (TOE00) and bit 1 (TOC001) of 16-bit timer output control register 00 (TOC00) to 1. This enables a square wave
with any selected frequency to be output.
Figure 6-29. Control Register Settings in Square-Wave Output Mode (1/2)
7
6
TMC00
0
0
7
6
CRC00
0
0
132
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
(a) 16-bit timer mode control register 00 (TMC00)
5
4
TMC003
TMC002
TMC001
0
0
1
1
0
(b) Capture/compare control register 00 (CRC00)
5
4
3
CRC002
CRC001
0
0
0
0/1
0/1
Preliminary User's Manual U16846EJ1V0UD
OVF00
0
Clears and starts on match between TM00 and CR000.
CRC000
0
CR000 used as compare register

Advertisement

Table of Contents
loading

This manual is also suitable for:

Ypd78f0101hYpd78f0102hYpd78f0103h

Table of Contents