PIC16C642-10E/SP Microchip Technology, PIC16C642-10E/SP Datasheet - Page 49

IC MCU OTP 4KX14 COMP 28DIP

PIC16C642-10E/SP

Manufacturer Part Number
PIC16C642-10E/SP
Description
IC MCU OTP 4KX14 COMP 28DIP
Manufacturer
Microchip Technology
Series
PIC® 16Cr
Datasheets

Specifications of PIC16C642-10E/SP

Core Processor
PIC
Core Size
8-Bit
Speed
10MHz
Peripherals
Brown-out Detect/Reset, LED, POR, WDT
Number Of I /o
22
Program Memory Size
7KB (4K x 14)
Program Memory Type
OTP
Ram Size
176 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 6 V
Oscillator Type
External
Operating Temperature
-40°C ~ 125°C
Package / Case
28-DIP (0.300", 7.62mm)
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Data Converters
-
Connectivity
-
The code example in Example 7-1 depicts the steps
required to configure the comparator module. RA3 and
RA4 are configured as digital outputs. RA0 and RA1
are configured as the V- inputs and RA2 as the V+ input
to both comparators.
EXAMPLE 7-1:
FLAG_REG
CLRF
CLRF
ANDLW
IORWF
MOVLW
MOVWF
BSF
MOVLW
MOVWF
BCF
CALL
MOVF
BCF
BSF
BSF
BCF
BSF
BSF
7.2
A single comparator is shown in Figure 7-3 along with
the relationship between the analog input levels and
the digital output. When the analog input at V
than the analog input V
is a digital low level. When the analog input at V
greater than the analog input V
comparator is a digital high level. The shaded areas of
the output of the comparator in Figure 7-3 represents
the uncertainty due to input offsets and response time.
1996 Microchip Technology Inc.
Comparator Operation
EQU 0x20
FLAG_REG
PORTA
0xC0
FLAG_REG,F
0x03
CMCON
STATUS,RP0
0x07
TRISA
STATUS,RP0
DELAY_10 s
CMCON,F
PIR1,CMIF
STATUS,RP0
PIE1,CMIE
STATUS,RP0
INTCON,PEIE
INTCON,GIE
INITIALIZING THE
COMPARATOR MODULE
IN
–, the output of the comparator
;10
;Init Flag Register
;Init PORTA
;Mask Comp bits
;Bits to Flag_Reg
;Init Comp Mode
;CM2:CM0 = 011
;Select Bank 1
;Init Data direction
;RA<2:0> to inputs
;RA<4:3> to outputs
;TRISA<7:5> read '0'
;Select Bank 0
;Read CMCON to end
;change condition
;Clear Pending Ints
;Select Bank 1
;Enable Comp Ints
;Select Bank 0
;Enable Periph Ints
;Global Int enable
IN
s delay
–, the output of the
IN
+ is less
IN
+ is
Preliminary
PIC16C64X & PIC16C66X
7.3
An external or internal reference signal may be used
depending on the comparator operating mode. The
analog signal that is present at V
signal at V
is adjusted accordingly (Figure 7-3).
FIGURE 7-3:
7.3.1
When external voltage references are used, the
comparator module can be configured to have the com-
parators operate from the same or different reference
sources. However, threshold detector applications may
require the same reference. The reference signal must
be between V
pin of the comparator(s).
7.3.2
The comparator module also allows the selection of an
internally
comparators. Section 8.0, contains a detailed descrip-
tion of the Voltage Reference Module that provides this
signal. The internal reference signal is used when the
comparators
(Figure 7-2). In this mode, the internal voltage refer-
ence is applied to the V
Output
V
V
IN
IN
-
+
Comparator Reference
V
V
EXTERNAL REFERENCE SIGNAL
INTERNAL REFERENCE SIGNAL
IN
IN
IN
generated
-
+
+, and the digital output of the comparator
SS
are
and V
SINGLE COMPARATOR
DD
in
IN
voltage
, and can be applied to either
+ pin of both comparators.
mode
IN
– is compared to the
reference
DS30559A-page 49
CM2:CM0 = 010
Output
for
the

Related parts for PIC16C642-10E/SP