Examples Of Use; Operation As Interval Timer (1) - NEC uPD784038 Series User Manual

16-bit single-chip microcontrollers
Table of Contents

Advertisement

8.8 EXAMPLES OF USE

8.8.1 Operation as Interval Timer (1)

When timer register 0 (TM0) is made free-running and a fixed value is added to the compare register (CR0n: n = 0, 1) in the
interrupt service routine, TM0 operates as an interval timer with the added fixed value as the cycle (see Figure 8-30).
This interval timer can count within the range shown in Table 8-1 (internal system clock f
Since TM0 has two compare registers, two interval timers with different cycles can be constructed.
The control register settings are shown in Figure 8-31, the setting procedure in Figure 8-32, and the processing in the interrupt
service routine in Figure 8-33.
TM0
Count Value
0H
Compare Register
(CR00)
INTC00
Interrupt Request
Remark Interval = n × 8/f
224
CHAPTER 8 TIMER/COUNTER 0
Figure 8-30 Interval Timer Operation (1) Timing
n
Timer Start
n
Interval
, 1 ≤ n ≤ FFFFH
XX
User's Manual U11316EJ4V1UD
FFFFH
MOD (2n)
MOD (2n)
MOD (3n)
Rewritten by
Rewritten by
Interrupt Program
Interrupt Program
Interval
Interval
= 32 MHz).
XX
FFFFH
MOD (3n)
MOD (4n)
Rewritten by
Interrupt Program

Advertisement

Table of Contents
loading

Table of Contents