NEC PD703114 User Manual page 384

V850e/ia2 32-bit single-chip microcontrollers
Table of Contents

Advertisement

(4) Compare operation
The TM3 register has two capture/compare registers. These are the CC30 register and the CC31 register. A
capture operation or a compare operation is performed according to the settings of both the CMS1 and CMS0
bits of the TMC31 register. If 1 is set in the CMS1 and CMS0 bits of the TMC31 register, the register
operates as a compare register.
A compare operation that compares the value that was set in the compare register and the TM3 count value
is performed.
If the TM3 count value matches the value of the compare register, which had been set in advance, a match
signal is sent to the output controller. The match signal causes the timer output pin (TO3) to change and an
interrupt request signal (INTCC30, INTCC31) to be generated at the same time.
If the CC30 or CC31 register is set to 0000H, "0000H" after the TM3 register counts up from FFFFH to 0000H
is judged as a match. In this case, the value of the TM3 register is cleared to 0 at the next count timing, but
0000H is not judged as a match at that time. 0000H when the TM3 register begins counting is not judged as
a match either.
If match clearing is enabled (CCLR bit = 1) for the CC30 register, the TM3 register is cleared when a match
with the TM3 register occurs during a compare operation.
(a) If CCLR bit = 1 and CC30 register is value other than 0000H
Count up
TM3
Compare register
(CC30)
TO3
(output)
Match detection
(INTCC30)
Remarks 1. The match is detected immediately after the count up, and the match detection signal is
generated.
2. n ≠ 0000H
384
CHAPTER 9 TIMER/COUNTER FUNCTION
Figure 9-93. Compare Operation Example (1/2)
n−1
User's Manual U15195EJ5V0UD
n
n
0000H
0001H

Advertisement

Table of Contents
loading

Table of Contents