Count Operation Timing - NEC PD750004 User Manual

4 bit single-chip microcomputer
Table of Contents

Advertisement

Count pulse(CP)
Modulo register
(TMODn)
Count register
(Tn)
TOUT F/F
(4) Applications of the timer/event counter
(a) Timer/event counter is used as an interval timer that generates interrupts at intervals of 30 ms.
• The high-order four bits of the mode register are set to 0100B to select maximum set time 43.7 ms
(at f
= 6.00 MHz).
X
• The low-order four bits of the mode register are set to 1100B.
• The modulo register is set to the following value:
30 ms/171 µs = 175.4 =
<Sample program>
SEL
MB15
MOV
XA,#0AEH
MOV
TMOD0,XA
MOV
XA,#01001100B
MOV
TM0,XA
EI
EI
IET0
Remark In this application, the TI0 pin can be used as an input pin.
(b) An interrupt is caused when the number of pulses (active high) applied to the TI0 pin reaches
100.
• The high-order four bits of the mode register are set to 0000 to select the rising edge.
• The low-order four bits of the mode register are set to 1100B.
• The modulo register is set to 99 = 100 – 1.
Figure 5-36. Count Operation Timing
0
1
2
n–1
Reset
Timer start indication
.
. AFH
; Set the modulo register
; Set the mode register and start the timer
; Enable an interrupt
; Enable a timer interrupt
CHAPTER 5 PERIPHERAL HARDWARE FUNCTIONS
n
n
0
1
2
Match
n–1
n
0
1
Match
2
3
4
119

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd750006Pd750008Pd75p0016

Table of Contents