PIC16C621-20/P Microchip Technology, PIC16C621-20/P Datasheet - Page 41
![IC MCU OTP 1KX14 COMP 18DIP](/photos/6/76/67657/18-dip_300mil__sml.jpg)
PIC16C621-20/P
Manufacturer Part Number
PIC16C621-20/P
Description
IC MCU OTP 1KX14 COMP 18DIP
Manufacturer
Microchip Technology
Series
PIC® 16Cr
Specifications of PIC16C621-20/P
Core Processor
PIC
Core Size
8-Bit
Speed
20MHz
Peripherals
Brown-out Detect/Reset, POR, WDT
Number Of I /o
13
Program Memory Size
1.75KB (1K x 14)
Program Memory Type
OTP
Ram Size
80 x 8
Voltage - Supply (vcc/vdd)
3 V ~ 6 V
Oscillator Type
External
Operating Temperature
0°C ~ 70°C
Package / Case
18-DIP (0.300", 7.62mm)
For Use With
ISPICR1 - ADAPTER IN-CIRCUIT PROGRAMMING309-1059 - ADAPTER 18 ZIF BD W/18SO PLUGSDVA16XP180 - ADAPTER DEVICE FOR MPLAB-ICEAC164010 - MODULE SKT PROMATEII DIP/SOIC
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Data Converters
-
Connectivity
-
Available stocks
Company
Part Number
Manufacturer
Quantity
Price
Company:
Part Number:
PIC16C621-20/P
Manufacturer:
Microchip Technology
Quantity:
135
The code example in Example 7-1 depicts the steps
required to configure the comparator module. RA3 and
RA4 are configured as digital output. RA0 and RA1 are
configured as the V- inputs and RA2 as the V+ input to
both comparators.
EXAMPLE 7-1:
7.2
A single comparator is shown in Figure 7-2 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-2 represent
the uncertainty due to input offsets and response time.
2003 Microchip Technology Inc.
MOVLW
MOVWF
CLRF
BSF
MOVLW
MOVWF
BCF
CALL
MOVF
BCF
BSF
BSF
BCF
BSF
BSF
0x03
CMCON
PORTA
STATUS,RP0
0x07
TRISA
STATUS,RP0
DELAY 10
CMCON,F
PIR1,CMIF
STATUS,RP0
PIE1,CMIE
STATUS,RP0
INTCON,PEIE ;Enable peripheral interrupts
INTCON,GIE
Comparator Operation
;Init comparator mode
;CM<2:0> = 011
;Init PORTA
;Select Bank1
;Initialize data direction
;Set RA<2:0> as inputs
;RA<4:3> as outputs
;TRISA<7:5> always read ‘0’
;Select Bank 0
;10µs delay
;Read CMCON to end change condition
;Clear pending interrupts
;Select Bank 1
;Enable comparator interrupts
;Select Bank 0
;Global interrupt enable
INITIALIZING
COMPARATOR MODULE
IN
-, the output of the comparator
IN
-, the output of the
IN
+ is less
IN
+ is
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-2).
FIGURE 7-2:
7.3.1
When external voltage references are used, the
comparator module can be configured to have the
comparators operate from the same or different
reference sources. However, threshold detector
applications may require the same reference. The
reference signal must be between V
can be applied to either pin of the comparator(s).
7.3.2
The comparator module also allows the selection of an
internally
comparators. Section 10, Instruction Sets, contains a
detailed description of the Voltage Reference Module
that provides this signal. The internal reference signal
is used when the comparators are in mode
CM<2:0>=010 (Figure 7-1). In this mode, the internal
voltage reference is applied to the V
comparators.
Output
V
V
V
V
utput
IN
IN
IN–
IN+
-
+
V
V
IN
IN
Comparator Reference
+
-
IN
generated
+, and the digital output of the comparator
EXTERNAL REFERENCE SIGNAL
INTERNAL REFERENCE SIGNAL
+
–
SINGLE COMPARATOR
voltage
PIC16C62X
IN
reference
- is compared to the
DS30235J-page 39
SS
IN
Output
and V
+ pin of both
for
DD
, and
the