Square-Wave Output Operation - NEC 78K0S/KB1+ User Manual

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

Advertisement

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
setting, refer to 6.5 Cautions Related to 16-bit Timer/Event Counter 00 (17) 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 13 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-27. Control Register Settings in Square-Wave Output Mode (1/2)
ES110
ES100
ES010
PRM00
0/1
0/1
0/1
7
6
5
CRC00
0
0
0
CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
(a) Prescaler mode register 00 (PRM00)
ES000
3
2
PRM001
PRM000
0/1
0
0
0/1
(b) Capture/compare control register 00 (CRC00)
4
3
CRC002
CRC001
CRC000
0
0
0/1
0/1
User's Manual U17446EJ3V1UD
0/1
Selects count clock.
Setting invalid (setting "10" is prohibited.)
Setting invalid (setting "10" is prohibited.)
0
CR000 used as compare register
109

Advertisement

Table of Contents
loading

Table of Contents