SN8P2740 Series
ADC, OP-amp, Comparator 8-Bit Micro-Controller
9.6 COMPARATOR 0 OPERATION EXPLAME
COMPARATOR 0 CONFIGURATION:
; Reset Comparator 0.
CLR
CM0M
; Clear CM0M register.
; Set Comparator 0 function mode.
B0BCLR
FCM0SF
; Normal comparator mode.
; Special function mode.
; or
B0BSET
FCM0SF
; Set Comparator 0 output pin.
B0BCLR
FCM0OEN
FCM0OEN
; Disable comparator 0 output pin.
; Enable comparator 0 output pin.
; or
B0BSET
; Set Comparator 0 interrupt trigger edge.
B0BCLR
FCM0G
; Falling edge.
; Rising edge.
; or
B0BSET
FCM0G
; Set Comparator 0 output de-bounce.
B0MOV
AND
OR
A, CMDB0
; Set CM0D[3:0] for comparator output de-bounce.
A, #11110000b
A, #0000nnnnb
CMDB0, A
B0MOV
; Clear CM0IRQ
B0BCLR
FCM0IRQ
; Enable Comparator 0 and interrupt function.
B0BSET
B0BSET
FCM0IEN
FCM0EN
; Enable Comparator 0 interrupt function.
; Enable Comparator 0.
SONiX TECHNOLOGY CO., LTD
Page 94
Version 2.0