PIC18F2320-I/SP Microchip Technology Inc., PIC18F2320-I/SP Datasheet - Page 223

no-image

PIC18F2320-I/SP

Manufacturer Part Number
PIC18F2320-I/SP
Description
Microcontroller; 8 KB Flash; 512 RAM; 256 EEPROM; 25 I/O; 28-Pin-SPDIP
Manufacturer
Microchip Technology Inc.
Datasheet

Specifications of PIC18F2320-I/SP

A/d Inputs
10-Channel, 10-Bit
Comparators
2
Cpu Speed
10 MIPS
Eeprom Memory
256 Bytes
Input Output
25
Interface
I2C/SPI/USART
Memory Type
Flash
Number Of Bits
8
Package Type
28-pin SPDIP
Programmable Memory
8K Bytes
Ram Size
512 Bytes
Speed
20 MHz
Timers
1-8-bit, 3-16-bit
Voltage, Range
2-5.5 V
Lead Free Status / Rohs Status
RoHS Compliant part Electrostatic Device
20.0
The comparator module contains two analog compara-
tors. The inputs and outputs for the comparators are
multiplexed with the RA0 through RA5 pins. The on-
chip voltage reference (Section 21.0 “Comparator
Voltage Reference Module”) can also be an input to
the comparators.
The CMCON register, shown as Register 20-1,
controls the comparator module’s input and output
multiplexers.
comparator configurations is shown in Figure 20-1.
REGISTER 20-1:
 2003 Microchip Technology Inc.
COMPARATOR MODULE
bit 7
bit 6
bit 5
bit 4
bit 3
bit 2-0
A
block
CMCON REGISTER
C2OUT: Comparator 2 Output bit
When C2INV = 0:
1 = C2 V
0 = C2 V
When C2INV = 1:
1 = C2 V
0 = C2 V
C1OUT: Comparator 1 Output bit
When C1INV = 0:
1 = C1 V
0 = C1 V
When C1INV = 1:
1 = C1 V
0 = C1 V
C2INV: Comparator 2 Output Inversion bit
1 = C2 output inverted
0 = C2 output not inverted
C1INV: Comparator 1 Output Inversion bit
1 = C1 output inverted
0 = C1 output not inverted
CIS: Comparator Input Switch bit
When CM2:CM0 = 110:
1 = C1 V
0 = C1 V
CM2:CM0: Comparator Mode bits
Figure 20-1 shows the Comparator modes and CM2:CM0 bit settings.
Legend:
R = Readable bit
- n = Value at POR
bit 7
C2OUT
diagram
R-0
C2 V
C2 V
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
IN
+ > C2 V
+ < C2 V
+ < C2 V
+ > C2 V
+ > C1 V
+ < C1 V
+ < C1 V
+ > C1 V
- connects to RA3/AN3
- connects to RA2/AN2
- connects to RA0/AN0
- connects to RA1/AN1
C1OUT
of
R-0
the
IN
IN
IN
IN
IN
IN
IN
IN
-
-
-
-
-
-
-
-
PIC18F2220/2320/4220/4320
various
C2INV
R/W-0
W = Writable bit
‘1’ = Bit is set
C1INV
R/W-0
20.1
There are eight modes of operation for the comparators.
The CM bits (CMCON<2:0>) are used to select these
modes. Figure 20-1 shows the eight possible modes.
The TRISA register controls the data direction of the
comparator pins for each mode. If the Comparator mode
is changed, the comparator output level may not be valid
for the specified mode change delay shown in the
Electrical Specifications (see Section 26.0 “Electrical
Characteristics”).
Note:
Comparator Configuration
R/W-0
U = Unimplemented bit, read as ‘0’
‘0’ = Bit is cleared
CIS
Comparator interrupts should be disabled
during a Comparator mode change.
Otherwise, a false interrupt may occur.
R/W-1
CM2
x = Bit is unknown
R/W-1
CM1
DS39599C-page 221
R/W-1
CM0
bit 0

Related parts for PIC18F2320-I/SP