PIC16C642-04/SO Microchip Technology, PIC16C642-04/SO Datasheet - Page 49

IC MCU OTP 4KX14 COMP 28SOIC

PIC16C642-04/SO

Manufacturer Part Number
PIC16C642-04/SO
Description
IC MCU OTP 4KX14 COMP 28SOIC
Manufacturer
Microchip Technology
Series
PIC® 16Cr
Datasheets

Specifications of PIC16C642-04/SO

Core Size
8-Bit
Program Memory Size
7KB (4K x 14)
Core Processor
PIC
Speed
4MHz
Peripherals
Brown-out Detect/Reset, LED, POR, WDT
Number Of I /o
22
Program Memory Type
OTP
Ram Size
176 x 8
Voltage - Supply (vcc/vdd)
4 V ~ 6 V
Oscillator Type
External
Operating Temperature
0°C ~ 70°C
Package / Case
28-SOIC (7.5mm Width)
Controller Family/series
PIC16C
No. Of I/o's
22
Ram Memory Size
176Byte
Cpu Speed
4MHz
No. Of Timers
1
Processor Series
PIC16C
Core
PIC
Data Bus Width
8 bit
Data Ram Size
176 B
Interface Type
RS- 232
Maximum Clock Frequency
4 MHz
Number Of Programmable I/os
33
Number Of Timers
8
Operating Supply Voltage
3 V to 6 V
Maximum Operating Temperature
+ 70 C
Mounting Style
SMD/SMT
3rd Party Development Tools
52715-96, 52716-328, 52717-734
Development Tools By Supplier
ICE2000, DM163022
Minimum Operating Temperature
0 C
On-chip Adc
10 bit
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Data Converters
-
Connectivity
-
Lead Free Status / Rohs Status
 Details
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-04/SO