Square-Wave Output Operation - NEC 78K0S/KA1+ Preliminary User's Manual

8-bit single-chip microcontrollers
Hide thumbs Also See for 78K0S/KA1+:
Table of Contents

Advertisement

www.DataSheet4U.com
6.4.4

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-27 for the set value).
<3> Set the TOC00 register (see Figure 6-27 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-27 for the set value).
Caution Changing the CR000 setting during TM00 operation may cause a malfunction. To change the
www.DataSheet4U.com
setting, refer to 6.5 Cautions Related to 16-Bit Timer/Event Counter 00 (11) Changing compare
register during timer operation.
Remarks 1. For the setting of the TO00 pin, see 6.3 (5) Port mode register 3 (PM3).
2. For how to enable the INTTM000 interrupt, see CHAPTER 12 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.
7
TMC00
0
7
CRC00
0
104
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Figure 6-27. Control Register Settings in Square-Wave Output Mode (1/2)
(a) 16-bit timer mode control register 00 (TMC00)
6
5
4
TMC003
TMC002
0
0
0
1
1
(b) Capture/compare control register 00 (CRC00)
6
5
4
3
CRC002
0
0
0
0
0/1
Preliminary User's Manual U16898EJ1V0UD
TMC001
OVF00
0
0
Clears and starts on match between TM00 and CR000.
CRC001
CRC000
0/1
0
CR000 used as compare register

Advertisement

Table of Contents
loading

This manual is also suitable for:

Mpd78f9221Mpd78f9222

Table of Contents