CHAPTER 6 16-BIT TIMER/EVENT COUNTER 00
Preliminary User’s Manual U19014EJ1V0UD
128
6.4.2 Square wave output operation
When 16-bit timer/event counter 00 operates as an interval timer (see
6.4.1
), a square wave can be output from the
TO00 pin by setting the 16-bit timer output control register 00 (TOC00) to 03H.
When TMC003 and TMC002 are set to 11 (count clear & start mode entered upon a match between TM00 and
CR000), the counting operation is started in synchronization with the count clock.
When the value of TM00 later matches the value of CR000, TM00 is cleared to 0000H, an interrupt signal
(INTTM000) is generated, and output of the TO00 pin is inverted. This TO00 pin output that is inverted at fixed
intervals enables TO00 to output a square wave.
Remarks 1.
For the setting of I/O pins, see
6.3 (6) Port mode register 0 (PM0)
.
2.
For how to enable the INTTM000 signal interrupt, see
CHAPTER 13 INTERRUPT FUNCTIONS
.
Figure 6-15. Block Diagram of Square Wave Output Operation
16-bit counter (TM00)
CR000 register
Operable bits
TMC003, TMC002
Count clock
Clear
Match signal
INTTM000 signal
Output
controller
TO00 pin
Figure 6-16. Basic Timing Example of Square Wave Output Operation
TM00 register
0000H
Operable bits
(TMC003, TMC002)
Compare register
(CR000)
TO00 pin output
Compare match interrupt
(INTTM000)
N
11
00
N
N
N
N
Interval
(N + 1)
Interval
(N + 1)
Interval
(N + 1)
Interval
(N + 1)
electronic components distributor