NEC PD750004 User Manual page 124

4 bit single-chip microcomputer
Table of Contents

Advertisement

µPD750008 USER'S MANUAL
(2) Reading the count
The count status of the basic interval timer (BT) can be read by using an 8-bit manipulation instruction.
No data can be loaded to the timer.
Caution When reading the count value of BT, execute a read instruction twice so that unstable
data which has been counted will not be read. If the two read values are reasonable, use
the second one as the result. If the two read values are far apart, retry from the beginning.
Examples 1. Read the count value of BT.
LOOP:
2. Set the high level width of pulses applied to the INT4 interrupt pin (both edges detected).
(The pulse width is assumed not to exceed the value (5.46 ms or longer at 6.00 MHz) set
in the BTM.)
<INT4 interrupt routine (MBE = 0)>
LOOP:
AA:
104
SET1
MBE
SEL
MB15
MOV
HL, #BT
MOV
XA, @HL
MOV
BC, XA
MOV
XA, @HL
SKE
XA, BC
BR
LOOP
MOV
XA, BT
MOV
BC, XA
MOV
XA, BT
SKE
A, C
BR
LOOP
MOV
A, X
SKE
A, B
BR
LOOP
SKT
PORT0.0
BR
AA
MOV
XA, BC
MOV
BUFF, XA
CLR1
FLAG
RETI
MOV
HL, #BUFF
MOV
A, C
SUBC
A, @HL
INCS
L
MOV
C, A
MOV
A, B
SUBC
A, @HL
MOV
B, A
; Set the BT address in HL
; First read
; Second read
; First read
; Store data
; Second read
; P00 = 1?
; NO
; Store data in data memory
; Clear data presence flag

Advertisement

Table of Contents
loading

This manual is also suitable for:

Pd750006Pd750008Pd75p0016

Table of Contents