English
Language : 

UPD784938 Datasheet, PDF (249/733 Pages) NEC – 16-Bit Single-Chip Microcontrollers
CHAPTER 9 TIMER/EVENT COUNTER 0
(3) Rewriting compare register (CR01)
If the current value of the CR01 is changed to a smaller value, and the CR01 value is made smaller than the timer counter
0 (TM0) value, the PPG cycle at that time will be extended to the time equivalent to a full-count by TM0. If CR01 is rewritten
after the compare register (CR00) and TM0 match, the output level at this time will be the inactive level until TM0 overflows
and becomes 0, and will then return to normal PPG output.
If CR01 is rewritten before CR00 and TM0 match, the active level will be output until CR00 and TM0 match. If CR00 and
TM0 match before TM0 overflows and becomes 0, the inactive level is output at that point. When TM0 overflows and
becomes 0, the active level will be output, and normal PPG output will be restored. CR01 rewriting should be performed
by the interrupt due to a match between TM0 and CR01, etc.
Figure 9-27. Example of Extended PPG Output Cycle
Full count value
n1
TM0
count value
0H
n1
n3
n1
n3
n5
n2
n2
n4
CR00
n3
n4
CR01
n1
n2
TO0
When value n2 which is smaller than the
TM0 value n5 is written to CR01 here,
the PPG cycle is extended.
If CR00 and TM0 match, TO0 enters
the inactive level. Otherwise, it
remains at the active level.
Remark ALV0 = 1
Caution If the PPG cycle is extremely short as compared with the time required to acknowledge an interrupt, the
value of CR01 cannot be rewritten by interrupt processing that is performed on coincidence between the
timer counter 0 (TM0) and compare register (CR01). Use another method (for example, to poll the interrupt
request flags by software with all the interrupts masked).
Preliminary User’s Manual U13987EJ1V0UM00
249