CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
User’s Manual U16898EJ3V0UD
106
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 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.
Figure 6-27. Control Register Settings in Square-Wave Output Mode (1/2)
(a) Prescaler mode register 00 (PRM00)
ES110
0/1
ES100
0/1
ES010
0/1
ES000
0/1
3
0
2
0
PRM001
0/1
PRM000
0/1
PRM00
Selects count clock.
Setting invalid (setting “10” is prohibited.)
Setting invalid (setting “10” is prohibited.)
(b) Capture/compare control register 00 (CRC00)
7
0
6
0
5
0
4
0
3
0
CRC002
0/1
CRC001
0/1
CRC000
0
CRC00
CR000 used as compare register