Chapter 7 timer/counter units – NEC PD78214 User Manual

Page 218

Advertising
background image

189

Chapter 7 Timer/Counter Units

7

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.

Fig. 7-95 Example of PPG Output Period Made Longer

n3

n1

n2

n4

n2

0H

CR20

CR21

TO2

n1

n3

n1

n4

n2

Full count value

n3

n5

TM2
count value

The PPG period is extended when a value,
n2 less than TM2 value, n5 is written to
CR21 here.

TO2 becomes inactive when CR20 coincides with TM2;
otherwise, TO2 remains active.

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.

Advertising
This manual is related to the following products: