SN8P2318 Series
C-type LCD, RFC 8-Bit Micro-Controller
SONiX TECHNOLOGY CO., LTD
Page 97
Version 1.5
T1 EVENT COUNTER FOR CONTINUOUS SIGNAL MEASUREMENT CONFIGURATION:
; Reset T1 timer.
CLR
T1M
; Clear T1M register.
; Set T1 clock rate and select/enable T1 capture timer.
MOV
A, #0nnnm000b
; “nnn” is T1rate[2:0] for T1 clock rate selection.
B0MOV
T1M, A
; “m” is T1 clock source control bit.
MOV
A, #00000001b
; Set capture timer function.
B0MOV
T1CKSM, A
; CPTG[1:0] must be set as
“01”.
;
“High pulse width measurement”
; Clear T1CH, T1CL.
CLR
T1CH
; Clear high byte first.
CLR
T1CL
; Clear low byte.
; Set T1VCH, T1VCL 10-bit capture timer for continuous signal measurement.
MOV
A, #value1
; Set high nibble first.
B0MOV
T1VCH, A
MOV
A, #value2
; Set low byte.
B0MOV
T1VCL, A
; Clear T1IRQ
B0BCLR
FT1IRQ
; Enable T1 timer, interrupt function and T1 capture timer function.
B0BSET
FT1IEN
; Enable T1 interrupt function.
B0BSET
FT1ENB
; Enable T1 timer.
B0BSET
FCPTVC
; Enable T1 event counter function.
; Set capture timer start bit.
B0BSET
FCPTStart