View
215
Download
0
Embed Size (px)
2007 Microchip Technology Inc. DS39599G
PIC18F2220/2320/4220/4320Data Sheet
28/40/44-Pin High-Performance,Enhanced Flash Microcontrollers
with 10-Bit A/D and nanoWatt Technology
DS39599G-page ii 2007 Microchip Technology Inc.
Information contained in this publication regarding deviceapplications and the like is provided only for your convenienceand may be superseded by updates. It is your responsibility toensure that your application meets with your specifications.MICROCHIP MAKES NO REPRESENTATIONS ORWARRANTIES OF ANY KIND WHETHER EXPRESS ORIMPLIED, WRITTEN OR ORAL, STATUTORY OROTHERWISE, RELATED TO THE INFORMATION,INCLUDING BUT NOT LIMITED TO ITS CONDITION,QUALITY, PERFORMANCE, MERCHANTABILITY ORFITNESS FOR PURPOSE. Microchip disclaims all liabilityarising from this information and its use. Use of Microchipdevices in life support and/or safety applications is entirely atthe buyers risk, and the buyer agrees to defend, indemnify andhold harmless Microchip from any and all damages, claims,suits, or expenses resulting from such use. No licenses areconveyed, implicitly or otherwise, under any Microchipintellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, KEELOQ logo, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, rfPIC and SmartShunt are registered trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
AmpLab, FilterLab, Linear Active Thermistor, Migratable Memory, MXDEV, MXLAB, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the U.S.A.
Analog-for-the-Digital Age, Application Maestro, CodeGuard, dsPICDEM, dsPICDEM.net, dsPICworks, dsSPEAK, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Mindi, MiWi, MPASM, MPLAB Certified logo, MPLIB, MPLINK, PICkit, PICDEM, PICDEM.net, PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, REAL ICE, rfLAB, Select Mode, Smart Serial, SmartTel, Total Endurance, UNI/O, WiperLock and ZENA are trademarks of Microchip Technology Incorporated in the U.S.A. and other countries.
SQTP is a service mark of Microchip Technology Incorporated in the U.S.A.
All other trademarks mentioned herein are property of their respective companies.
2007, Microchip Technology Incorporated, Printed in the U.S.A., All Rights Reserved.
Printed on recycled paper.
Note the following details of the code protection feature on Microchip devices: Microchip products meet the specification contained in their particular Microchip Data Sheet.
Microchip believes that its family of products is one of the most secure families of its kind on the market today, when used in the intended manner and under normal conditions.
There are dishonest and possibly illegal methods used to breach the code protection feature. All of these methods, to our knowledge, require using the Microchip products in a manner outside the operating specifications contained in Microchips Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
Microchip is willing to work with the customer who is concerned about the integrity of their code.
Neither Microchip nor any other semiconductor manufacturer can guarantee the security of their code. Code protection does not mean that we are guaranteeing the product as unbreakable.
Code protection is constantly evolving. We at Microchip are committed to continuously improving the code protection features of ourproducts. Attempts to break Microchips code protection feature may be a violation of the Digital Millennium Copyright Act. If such actsallow unauthorized access to your software or other copyrighted work, you may have a right to sue for relief under that Act.
Microchip received ISO/TS-16949:2002 certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona; Gresham, Oregon and design centers in California and India. The Companys quality system processes and procedures are for its PIC MCUs and dsPIC DSCs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products. In addition, Microchips quality system for the design and manufacture of development systems is ISO 9001:2000 certified.
2007 Microchip Technology Inc. DS39599G-page 1
Low-Power Features: Power-Managed modes:
- Run: CPU on, peripherals on- Idle: CPU off, peripherals on- Sleep: CPU off, peripherals off
Power Consumption modes:- PRI_RUN: 150 A, 1 MHz, 2V- PRI_IDLE: 37 A, 1 MHz, 2V- SEC_RUN: 14 A, 32 kHz, 2V- SEC_IDLE: 5.8 A, 32 kHz, 2V- RC_RUN: 110 A, 1 MHz, 2V- RC_IDLE: 52 A, 1 MHz, 2V- Sleep: 0.1 A, 1 MHz, 2V
Timer1 Oscillator: 1.1 A, 32 kHz, 2V Watchdog Timer: 2.1 A Two-Speed Oscillator Start-up
Oscillators: Four Crystal modes:
- LP, XT, HS: up to 25 MHz- HSPLL: 4-10 MHz (16-40 MHz internal)
Two External RC modes, Up to 4 MHz Two External Clock modes, Up to 40 MHz Internal Oscillator Block:
- 8 user-selectable frequencies: 31 kHz, 125 kHz, 250 kHz, 500 kHz, 1 MHz, 2 MHz, 4 MHz, 8 MHz
- 125 kHz-8 MHz calibrated to 1%- Two modes select one or two I/O pins- OSCTUNE Allows user to shift frequency
Secondary Oscillator using Timer1 @ 32 kHz Fail-Safe Clock Monitor
- Allows for safe shutdown if peripheral clock stops
Peripheral Highlights: High-Current Sink/Source 25 mA/25 mA Three External Interrupts Up to 2 Capture/Compare/PWM (CCP) modules:
- Capture is 16-bit, max. resolution is 6.25 ns (TCY/16)- Compare is 16-bit, max. resolution is 100 ns (TCY)- PWM output: PWM resolution is 1 to 10-bit
Enhanced Capture/Compare/PWM (ECCP) module:- One, two or four PWM outputs- Selectable polarity- Programmable dead time- Auto-Shutdown and Auto-Restart
Compatible 10-Bit, Up to 13-Channel Analog-to-Digital Converter (A/D) module with Programmable Acquisition Time
Dual Analog Comparators Addressable USART module:
- RS-232 operation using internal oscillator block (no external crystal required)
Special Microcontroller Features: 100,000 Erase/Write Cycle Enhanced Flash Program
Memory Typical 1,000,000 Erase/Write Cycle Data EEPROM
Memory Typical Flash/Data EEPROM Retention: > 40 Years Self-Programmable under Software Control Priority Levels for Interrupts 8 x 8 Single-Cycle Hardware Multiplier Extended Watchdog Timer (WDT):
- Programmable period from 41 ms to 131s- 2% stability over VDD and Temperature
Single-Supply 5V In-Circuit Serial Programming (ICSP) via Two Pins
In-Circuit Debug (ICD) via Two Pins Wide Operating Voltage Range: 2.0V to 5.5V
Device
Program Memory Data Memory
I/O 10-BitA/D (ch)
CCP/ECCP(PWM)
MSSP
USART
Com
para
tors
Timers8/16-bitFlash
(bytes)# Single WordInstructions
SRAM(bytes)
EEPROM(bytes) SPI
MasterI2C
PIC18F2220 4096 2048 512 256 25 10 2/0 Y Y Y 2 2/3PIC18F2320 8192 4096 512 256 25 10 2/0 Y Y Y 2 2/3PIC18F4220 4096 2048 512 256 36 13 1/1 Y Y Y 2 2/3PIC18F4320 8192 4096 512 256 36 13 1/1 Y Y Y 2 2/3
28/40/44-Pin High-Performance, Enhanced Flash MCUswith 10-Bit A/D and nanoWatt Technology
PIC18F2220/2320/4220/4320
PIC18F2220/2320/4220/4320
DS39599G-page 2 2007 Microchip Technology Inc.
Pin Diagrams
RB7/KBI3/PGDRB6/KBI2/PGCRB5/KBI1/PGMRB4/AN11/KBI0RB3/AN9/CCP2*RB2/AN8/INT2RB1/AN10/INT1RB0/AN12/INT0VDDVSSRD7/PSP7/P1DRD6/PSP6/P1CRD5/PSP5/P1BRD4/PSP4RC7/RX/DTRC6/TX/CKRC5/SDORC4/SDI/SDARD3/PSP3RD2/PSP2
MCLR/VPP/RE3RA0/AN0RA1/AN1
RA2/AN2/VREF-/CVREFRA3/AN3/VREF+
RA4/T0CKI/C1OUTRA5/AN4/SS/LVDIN/C2OUT
RE0/AN5/RDRE1/AN6/WRRE2/AN7/CS
VDDVSS
OSC1/CLKI/RA7OSC2/CLKO/RA6
RC0/T1OSO/T1CKIRC1/T1OSI/CCP2*
RC2/CCP1/P1ARC3/SCK/SCL
RD0/PSP0RD1/PSP1
1234567891011121314151617181920
4039383736353433323130292827262524232221
PIC
18F4
320
PIC
18F2
320
1011
23456
1
87
9
121314 15
1617181920
232425262728
2221
MCLR/VPPRA0/AN0RA1/AN1
RA2/AN2/VREF-/CVREFRA3/AN3/VREF+
RA4/T0CKI/C1OUTRA5/AN4/SS/LVDIN/C2OUT
VSSOSC1/CLKI/RA7
OSC2/CLKO/RA6RC0/T1OSO/T1CKIRC1/T1OSI/CCP2*
RC2/CCP1/P1ARC3/SCK/SCL
RB7/KBI3/PGDRB6/KBI2/PGCRB5/KBI1/PGMRB4/AN11/KBI0RB3/AN9/CCP2*RB2/AN8/INT2RB1/AN10/INT1RB0/AN12/INT0VDDVSSRC7/RX/DTRC6/TX/CKRC5/SDORC4/SDI/SDA
40-Pin PDIP
28-Pin SPDIP, SOIC
Note: Pin compatible with 40-pin PIC16C7X devices.
PIC
18F4
220
PIC
18F2
220
* RB3 is the alternate pin for the CCP2 pin multiplexing.
2007 Microchip Technology Inc. DS39599G-page 3
PIC18F2220/2320/4220/4320Pin Diagrams (Cont.d)
1011
23456
1
18 19 20 21 2212 13 14 15
38
87
44 43 42 41 40 3916 17
2930313233
232425262728
36 3435
9
PIC18F4220
37
RA
3/A
N3/
VRE
F+R
A2/A
N2/
V REF
-/CVR
EFR
A1/
AN1
RA
0/AN
0M
CLR
/VP
P/R
E3NC
RB
7/K
BI3
/PG
DR
B6/
KB
I2/P
GC
RB
5/K
BI1/
PG
MR
B4/A
N11
/KB
I0NC
RC
6/TX
/CK
RC
5/S
DO
RC
4/S
DI/S
DA
RD
3/P
SP3
RD
2/P
SP2
RD
1/P
SP1
RD
0/P
SP0
RC
3/S
CK
/SC
LR
C2/
CC
P1/
P1A
RC
1/T1
OSI
/CC
P2*
NC
NCR