Example Of Ppg Output Period Made Longer - NEC PD78212 User Manual

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

Advertisement

2. If the current value of the CR21 compare register is decreased below the value of 8-bit timer 2 (TM2), the PPG period becomes
as long as the full-count time of TM2. At this time, if CR21 is rewritten after the value of the CR20 compare register coincides
with the value of TM2, the inactive level is output until TM2 overflows to 0, then normal PPG output is resumed. If CR21 is
rewritten before the value of CR20 coincides with the value of TM2, the active level is output until the value of CR20 coincides
with the value of TM2. When the value of CR20 coincides with the value of TM2 before TM2 overflows to 0, the inactive level
is output at that time. When TM2 overflows to 0, the active level is output, and normal PPG output is resumed. Rewrite CR21,
if required, by using an interrupt generated by a coincidence between TM2 and CR21.
TM2
count value
0H
CR20
CR21
TO2
Remark ALV2 = 1
3. If the PPG period is too short for interrupt acceptance, the measures described in Cautions 1 and 2 above do not lead to solution.
Consider other measures (such as masking all interrupts and polling interrupt request flags by software).
4. If timer output is disabled (ENTOn = 0: n = 2, 3), the output level on the TOn (n = 2, 3) is the inverted value of the value set in
ALVn (n = 2, 3). Accordingly, note that if timer output is disabled when the PPG output function is selected, the active level is
output.
Fig. 7-95 Example of PPG Output Period Made Longer
n1
n3
n3
n1
The PPG period is extended when a value,
n2 less than TM2 value, n5 is written to
CR21 here.
Chapter 7 Timer/Counter Units
Full count value
n1
n3
n5
n2
TO2 becomes inactive when CR20 coincides with TM2;
otherwise, TO2 remains active.
n2
n4
n4
n2
189
7

Advertisement

Table of Contents
loading

Table of Contents