
104
µ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.
SET1
MBE
SEL
MB15
MOV
HL, #BT
; Set the BT address in HL
LOOP:
MOV
XA, @HL
; First read
MOV
BC, XA
MOV
XA, @HL
; Second read
SKE
XA, BC
BR
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:
MOV
XA, BT
; First read
MOV
BC, XA
; Store data
MOV
XA, BT
; Second read
SKE
A, C
BR
LOOP
MOV
A, X
SKE
A, B
BR
LOOP
SKT
PORT0.0
; P00 = 1?
BR
AA
; NO
MOV
XA, BC
; Store data in data memory
MOV
BUFF, XA
CLR1
FLAG
; Clear data presence flag
RETI
AA:
MOV
HL, #BUFF
MOV
A, C
SUBC
A, @HL
INCS
L
MOV
C, A
MOV
A, B
SUBC
A, @HL
MOV
B, A
Summary of Contents for PD750004
Page 8: ... MEMO ...
Page 20: ... xii MEMO ...
Page 234: ...214 µPD750008 USER S MANUAL MEMO ...
Page 244: ...224 µPD750008 USER S MANUAL MEMO ...
Page 248: ...228 µPD750008 USER S MANUAL MEMO ...
Page 254: ...234 µPD75008 USER S MANUAL MEMO ...
Page 328: ...308 µPD750008 USER S MANUAL MEMO ...
Page 330: ...310 µPD750008 USER S MANUAL MEMO ...
Page 342: ...322 µPD750008 USER S MANUAL MEMO ...