Compare Register And Capture Register Operations; Compare Operation - NEC PD78212 User Manual

8-bit single-chip microcomputer sub-series
Table of Contents

Advertisement

7.1.5 Compare Register and Capture Register Operations

(1) Compare operation

The 16-bit timer/counter performs an operation to compare the values set in the compare registers with timer
count values.
When the values set in the compare registers (CR00, CR01) coincide with count values of 16-bit timer 0 (TM0),
the coincidence signal is sent to the output control circuit. At the same time, the interrupt requests (INTC00,
INTC01) are generated.
After the value of the CR01 register coincides with a count value of TM0, the count value of TM0 can be cleared.
Thus, the 16-bit timer/counter can operate as an interval timer for repeatedly counting up to the value set in
the CR01 register.
Caution Before the 16-bit timer/counter can perform a compare operation, a value must be loaded into the compare register or
registers used.
TM0
count value
0H
Count starts
CE0←1
INTC00
interrupt request
INTC01
interrupt request
OVF0
Fig. 7-9 Compare Operation
Value of CR01
Value of CR00
Coincidence
Coincidence
Remark CLR01 = 0
Chapter 7 Timer/Counter Units
FFFFH
Value of CR01
Value of CR00
Coincidence
Coincidence
Cleared by software
7
FFFFH
117

Advertisement

Table of Contents
loading

Table of Contents