PIC18F46K22-I/MV Microchip Technology, PIC18F46K22-I/MV Datasheet - Page 308

64KB, Flash, 3968bytes-RAM,8-bit Family,nanoWatt XLP 40 UQFN 5x5x0.5mm TUBE

PIC18F46K22-I/MV

Manufacturer Part Number
PIC18F46K22-I/MV
Description
64KB, Flash, 3968bytes-RAM,8-bit Family,nanoWatt XLP 40 UQFN 5x5x0.5mm TUBE
Manufacturer
Microchip Technology
Series
PIC® XLP™ 18Fr
Datasheet

Specifications of PIC18F46K22-I/MV

Core Processor
PIC
Core Size
8-Bit
Speed
64MHz
Connectivity
I²C, SPI, UART/USART
Peripherals
Brown-out Detect/Reset, HLVD, POR, PWM, WDT
Number Of I /o
35
Program Memory Size
64KB (32K x 16)
Program Memory Type
FLASH
Eeprom Size
1K x 8
Ram Size
3.8K x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 30x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
40-UFQFN Exposed Pad
Processor Series
PIC18F
Core
PIC
Data Bus Width
8 bit
Data Ram Size
4 KB
Number Of Programmable I/os
36
Number Of Timers
3 x 8-bit. 4 x 16-bit
Operating Supply Voltage
1.8 V to 5.5 V
Mounting Style
SMD/SMT
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
PIC18(L)F2X/4XK22
18.4
The comparator interrupt flag will be set whenever
there is a change in the output value of the comparator.
Changes are recognized by means of a mismatch
circuit which consists of two latches and an exclusive-
or gate (see
the comparator output value, when the CMxCON0
register is read or written. The value is latched on the
third cycle of the system clock, also known as Q3. This
first latch retains the comparator value until another
read or write of the CMxCON0 register occurs or a
Reset takes place. The second latch is updated with
the comparator output value on every first cycle of the
system clock, also known as Q1. When the output
value of the comparator changes, the second latch is
updated and the output values of both latches no
longer match one another, resulting in a mismatch
condition. The latch outputs are fed directly into the
inputs of an exclusive-or gate. This mismatch condition
is detected by the exclusive-or gate and sent to the
interrupt circuitry. The mismatch condition will persist
until the first latch value is updated by performing a
read of the CMxCON0 register or the comparator
output returns to the previous state.
When the mismatch condition occurs, the comparator
interrupt flag is set. The interrupt flag is triggered by the
edge of the changing value coming from the exclusive-
or gate. This means that the interrupt flag can be reset
once it is triggered without the additional step of read-
ing or writing the CMxCON0 register to clear the mis-
match latches. When the mismatch registers are
cleared, an interrupt will occur upon the comparator’s
return to the previous state, otherwise no interrupt will
be generated.
Software will need to maintain information about the
status of the comparator output, as read from the
CMxCON0 register, or CM2CON1 register, to determine
the actual change that has occurred. See Figures
and 18-4.
The CxIF bit of the PIR2 register is the comparator
interrupt flag. This bit must be reset by software by
clearing it to ‘0’. Since it is also possible to write a ‘1’ to
this register, an interrupt can be generated.
In mid-range Compatibility mode the CxIE bit of the
PIE2 register and the PEIE/GIEL and GIE/GIEH bits of
the INTCON register must all be set to enable compar-
ator interrupts. If any of these bits are cleared, the inter-
rupt is not enabled, although the CxIF bit of the PIR2
register will still be set if an interrupt condition occurs.
DS41412D-page 308
Note 1: A write operation to the CMxCON0
2: Comparator
Comparator Interrupt Operation
Figure
register will also clear the mismatch
condition because all writes include a read
operation at the beginning of the write
cycle.
correctly regardless of the state of CxOE.
18-2). The first latch is updated with
interrupts
will
operate
18-3
Preliminary
18.4.1
The comparator mismatch latches can be preset to the
desired state before the comparators are enabled.
When the comparator is off the CxPOL bit controls the
CxOUT level. Set the CxPOL bit to the desired CxOUT
non-interrupt level while the CxON bit is cleared. Then,
configure the desired CxPOL level in the same instruc-
tion that the CxON bit is set. Since all register writes are
performed as a read-modify-write, the mismatch
latches will be cleared during the instruction read
phase and the actual configuration of the CxON and
CxPOL bits will be occur in the final write phase.
FIGURE 18-3:
FIGURE 18-4:
Q1
Q3
CxIN+
CxIN
Set CxIF (edge)
CxIF
Q1
Q3
CxIN+
CxOUT
Set CxIF (edge)
CxIF
Note 1: If a change in the CMxCON0 register
2: When either comparator is first enabled,
Cleared by CMxCON0 Read
PRESETTING THE MISMATCH
LATCHES
(CxOUT) should occur when a read oper-
ation is being executed (start of the Q2
cycle), then the CxIF interrupt flag of the
PIR2 register 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
CMxCON0 READ
COMPARATOR
INTERRUPT TIMING WITH
CMxCON0 READ
 2010 Microchip Technology Inc.
Reset by Software
Reset by Software

Related parts for PIC18F46K22-I/MV