English
Language : 

UPD784938 Datasheet, PDF (301/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 10 TIMER/EVENT COUNTER 1
10.8 Cautions
(1) While timer/event counter 1 is operating (while the CE1 bit of the timer control register 1 (TMC1) is set), malfunctioning
may occur if the contents of the following registers are rewritten. This is because it is undefined which takes precedence
in a contention, the change in the hardware functions due to rewriting the register, or the change in the status because
of the function before rewriting.
Therefore, be sure to stop the counter operation for the sake of safety before rewriting the contents of the following registers.
• Prescaler mode register 1 (PRM1)
• Capture/compare control register 1 (CRC1)
• CMD2 bit of timer control register 1 (TMC1)
(2) If the contents of the compare register (CR1n: n = 0 or 1) coincide with those of TM1 when an instruction that stops timer
counter 1 (TM1) operation is executed, the counting operation of TM1 stops, but an interrupt request is generated.
In order not to generate the interrupt when stopping the operation of TM1, mask the interrupt in advance by using the interrupt
mask register before stopping TM1.
Example
Program that may generate interrupt request
Program that does not generate interrupt request
CLR1
OR
CE1
MK0L, #C0H
← Interrupt request from
timer/event counter 1
occurs between these
instructions
OR
CLR1
CLR1
CLR1
...
MK0L, #C0H
CE1
CIF10
CIF11 ...
← Disables interrupt from timer/
event counter 1
← Clears interrupt request flag
from timer/event counter 1
(3) Up to 1 count clock is required after an operation to start timer/event counter 1 (CE1 ← 1) has been performed before timer/
event counter 1 actually starts (refer to Figure 10-30).
For example, when using timer/event counter 1 as an interval timer, the first interval time is delayed by up to 1 clock. The
second and those that follow are at the specified interval.
Figure 10-30. Operation when Counting is Started
Count clock
TM1
0
0
1
2
3
CE1
Timing to start actual counting
Count start command (CE1 ← 1)
by software
Preliminary User’s Manual U13987EJ1V0UM00
301