Specifications
S1C62N82 TECHNICAL SOFTWARE EPSON II-55
CHAPTER 3: PERIPHERAL CIRCUITS (Analog Comparator)
Example of CMP
control program
(At fosc1 = 32.768 kHz)
Label Mnemonic/operand Comment
LD X,0FBH ;Set CMP circuit address
OR MX,0001B ;CMP circuit on
LD A,08H ;
LOOP: ADD A,01H ; Wait about 1 ms
JP NZ,LOOP ;
LD A,MX ;A register ← CMPDT
AND MX,1110B ;CMP circuit off
Execution of the above program loads CMP output data
CMPDT into D1 of the A register.
It takes about 1 ms for the CMP output to become stable
when the circuit is turned on. Therefore, the program must
include a wait time of at least 1 ms before the output data is
loaded after the CMP circuit has been turned on.