PIC12F1822 MICROCHIP [Microchip Technology], PIC12F1822 Datasheet - Page 163

no-image

PIC12F1822

Manufacturer Part Number
PIC12F1822
Description
8/14-Pin Flash Microcontrollers with nanoWatt XLP Technology
Manufacturer
MICROCHIP [Microchip Technology]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
PIC12F1822-E/SN
Manufacturer:
ABILIS
Quantity:
15 400
Part Number:
PIC12F1822-E/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-E/SN
0
Part Number:
PIC12F1822-I/MF
Manufacturer:
ALLEGRO
Quantity:
1 001
Part Number:
PIC12F1822-I/MF
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-I/P
Manufacturer:
MICROCHIP
Quantity:
1 200
Part Number:
PIC12F1822-I/P
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-I/SN
Manufacturer:
MICROCHIP
Quantity:
4 500
Part Number:
PIC12F1822-I/SN
Manufacturer:
MICROCHI
Quantity:
1 700
Part Number:
PIC12F1822-I/SN
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822-I/SN
0
Company:
Part Number:
PIC12F1822-I/SN
Quantity:
30 000
Part Number:
PIC12F1822T-I/MF
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
PIC12F1822T-I/SN
0
18.3
A selectable amount of separation voltage can be
added to the input pins of each comparator to provide a
hysteresis function to the overall operation. Hysteresis
is enabled by setting the CxHYS bit of the CMxCON0
register.
These hysteresis levels change as a function of the
comparator’s Speed/Power mode selection.
Table 18-2 shows the hysteresis levels.
TABLE 18-2:
These levels are approximate.
See Section 29.0 “Electrical Specifications” for
more information.
18.4
The output resulting from a comparator operation can
be used as a source for gate control of Timer1. See
Section 20.6 “Timer1 Gate” for more information.
This feature is useful for timing the duration or interval
of an analog event.
It is recommended that the comparator output be syn-
chronized to Timer1. This ensures that Timer1 does not
increment while a change in the comparator is occur-
ring.
18.4.1
The output from either comparator, C1 or C2, can be
synchronized with Timer1 by setting the CxSYNC bit of
the CMxCON0 register.
Once enabled, the comparator output is latched on the
falling edge of the Timer1 source clock. If a prescaler is
used with Timer1, the comparator output is latched after
the prescaling function. To prevent a race condition, the
comparator output is latched on the falling edge of the
Timer1 clock source and Timer1 increments on the
rising edge of its clock source. See the Comparator
Block Diagram (Figure ) and the Timer1 Block Diagram
(Figure 20-1) for more information.
 2010 Microchip Technology Inc.
CxSP
0
1
Comparator Hysteresis
Timer1 Gate Operation
COMPARATOR OUTPUT
SYNCHRONIZATION
CxHYS Enabled
HYSTERESIS LEVELS
± 20mV
± 3mV
CxHYS Disabled
<< ± 1mV
± 3mV
PIC12F/LF1822/16F/LF1823
Preliminary
18.5
An interrupt can be generated upon a change in the
output value of the comparator for each comparator, a
rising edge detector and a falling edge detector are
present.
When either edge detector is triggered and its associ-
ated enable bit is set (CxINTP and/or CxINTN bits of
the CMxCON1 register), the Corresponding Interrupt
Flag bit (CxIF bit of the PIR2 register) will be set.
To enable the interrupt, you must set the following bits:
• CxON, CxPOL and CxSP bits of the CMxCON0
• CxIE bit of the PIE2 register
• CxINTP bit of the CMxCON1 register (for a rising
• CxINTN bit of the CMxCON1 register (for a falling
• PEIE and GIE bits of the INTCON register
The associated interrupt flag bit, CxIF bit of the PIR2
register, must be cleared in software. If another edge is
detected while this flag is being cleared, the flag will still
be set at the end of the sequence.
18.6
Configuring the CxPCH<1:0> bits of the CMxCON1
register directs an internal voltage reference or an
analog pin to the non-inverting input of the comparator:
• C1IN+ or C2IN+ analog pin
• DAC
• FVR (Fixed Voltage Reference)
• V
See Section 14.0 “Fixed Voltage Reference (FVR)”
for more information on the Fixed Voltage Reference
module.
See
(DAC) Module” for more information on the DAC input
signal.
Any time the comparator is disabled (CxON = 0), all
comparator inputs are disabled.
register
edge detection)
edge detection)
Note:
SS
Section 16.0 “Digital-to-Analog
(Ground)
Comparator Interrupt
Comparator Positive Input
Selection
Although a comparator is disabled, an
interrupt can be generated by changing
the output polarity with the CxPOL bit of
the CMxCON0 register, or by switching the
comparator on or off with the CxON bit of
the CMxCON0 register.
DS41413A-page 163
Converter

Related parts for PIC12F1822