Toshiba – Toshiba TMP87CP24AF User Manual
Page 71
Attention! The text in this document has been recognized automatically. To view the original document, you can use the "Original mode".

TOSHIBA
TMP87CM24A/P24A
Example :
Duty measurement (Resolution fc/2^ [Hz])
CLR
(INTTC1SW). 0
; INTTC1 service switch initial setting
LD
(EINTCR),00000000B
; Sets the rise edge at the INT2 edge
LD
(TCI CR), 0000011 OB
; Sets the TCI mode and source clock
SET
El
LD
(EIRL).4
; Enables INTTC1
(TC1CR),00110110B
; Starts TCI with an external trigger
CPL
(INTTC1SW). 0
; Complements INTTC1 service switch
JRS
F,SINTTC1
LD
(HPULSE),(TREG1BL)
; ReadsTREGIB
LD
(HPULSE + 1),(TREG1BH)
RETI
LD
(WIDTH), (TREG1BL)
; Reads TREG IB (Period)
LD
(WIDTH+ 1),(TREG1BH)
RETI
DW
PINTTC1
WIDTH
^HPULSE
TCI pin
INTTC1SW
_r
Note : In case offcl2^ is selected on the pulse width measurement mode. The LSB of counter (TREG1B)
is always "0". In the other source clock is selected, the value of counter correspond with real
count.
3
-
24-71
2002
-
10-03