PIC12F683-I/SN Microchip Technology Inc., PIC12F683-I/SN Datasheet - Page 57

no-image

PIC12F683-I/SN

Manufacturer Part Number
PIC12F683-I/SN
Description
8 PIN, 3.5 KB FLASH, 128 RAM, 6 I/O
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC12F683-I/SN

A/d Inputs
4-Channel, 10-Bit
Comparators
1
Cpu Speed
5 MIPS
Eeprom Memory
256 Bytes
Input Output
5
Memory Type
Flash
Number Of Bits
8
Package Type
8-pin SOIC-N
Programmable Memory
3.5K Bytes
Ram Size
128 Bytes
Speed
20 MHz
Timers
2-8-bit, 1-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC12F683-I/SN
Manufacturer:
FREESCALE
Quantity:
2 119
Part Number:
PIC12F683-I/SN
Manufacturer:
Microchip Technology
Quantity:
46 465
Part Number:
PIC12F683-I/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F683-I/SN
0
8.6
The comparator interrupt flag is set whenever there is
a change in the output value of the comparator.
Changes are recognized by means of a mismatch cir-
cuit which consists of two latches and an exclusive-or
gate (see Figure 8.2). One latch is updated with the
comparator output level when the CMCON0 register is
read. This latch retains the value until the next read of
the CMCON0 register or the occurrence of a Reset.
The other latch of the mismatch circuit is updated on
every Q1 system clock. A mismatch condition will occur
when a comparator output change is clocked through
the second latch on the Q1 clock cycle. The mismatch
condition will persist, holding the CMIF bit of the PIR1
register true, until either the CMCON0 register is read
or the comparator output returns to the previous state.
Software will need to maintain information about the
status of the comparator output to determine the actual
change that has occurred.
The CMIF bit of the PIR1 register, is the comparator
interrupt flag. This bit must be reset in software by
clearing it to ‘0’. Since it is also possible to write a ‘1’ to
this register, a simulated interrupt may be initiated.
The CMIE bit of the PIE1 register and the PEIE and GIE
bits of the INTCON register must all be set to enable
comparator interrupts. If any of these bits are cleared,
the interrupt is not enabled, although the CMIF bit of
the PIR1 register will still be set if an interrupt condition
occurs.
The user, in the Interrupt Service Routine, can clear the
interrupt in the following manner:
a)
b)
A persistent mismatch condition will preclude clearing
the CMIF interrupt flag. Reading CMCON0 will end the
mismatch condition and allow the CMIF bit to be
cleared.
© 2006 Microchip Technology Inc.
Note:
Note:
Any read or write of CMCON0. This will end the
mismatch condition.
Clear the CMIF interrupt flag.
Comparator Interrupt Operation
A write operation to the CMCON0 register
will also clear the mismatch condition
because
operation at the beginning of the write
cycle.
If a change in the CMCON0 register
(COUT) should occur when a read
operation is being executed (start of the
Q2 cycle), then the CMIF interrupt flag
may not get set.
all
writes
include
a
read
FIGURE 8-5:
FIGURE 8-6:
Q1
Q3
CIN+
COUT
Set CMIF (level)
CMIF
Q1
Q3
CIN+
COUT
Set CMIF (level)
CMIF
Note 1: If a change in the CMCON0 register
cleared by CMCON0 read
2: When either comparator is first enabled,
(COUT) should occur when a read opera-
tion is being executed (start of the Q2
cycle), then the CMIF of the PIR1 register
interrupt flag may not get set.
bias circuitry in the Comparator module
may cause an invalid output from the
comparator until the bias circuitry is
stable. Allow about 1 s for bias settling
then clear the mismatch condition and
interrupt flags before enabling comparator
interrupts.
T
T
RT
RT
COMPARATOR
INTERRUPT TIMING W/O
CMCON0 READ
COMPARATOR
INTERRUPT TIMING WITH
CMCON0 READ
PIC12F683
DS41211C-page 55
reset by software
reset by software

Related parts for PIC12F683-I/SN