beautypg.com

5 compare register and capture register operations, Chapter 7 timer/counter units – NEC PD78214 User Manual

Page 146

background image

117

Chapter 7 Timer/Counter Units

7

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.

Fig. 7-9 Compare Operation

Remark CLR01 = 0

Coincidence

Coincidence

Coincidence

Coincidence

TM0
count value

Count starts

INTC00

interrupt request

INTC01

interrupt request

OVF0

0H

Cleared by software

FFFFH

CE0

←1

FFFFH

Value of CR01

Value of CR00

Value of CR01

Value of CR00

This manual is related to the following products: