Transcription of PIC18F2420/2520/4420/4520 Data Sheet
1 2004 Microchip Technology Sheet28/40/44-PinEnhanced Flash Microcontrollerswith 10-Bit A/D and nanoWatt TechnologyDS39631A-page iiPreliminary 2004 Microchip Technology contained in this publication regarding deviceapplications and the like is intended through suggestion onlyand may be superseded by updates. It is your responsibility toensure that your application meets with your representation or warranty is given and no liability isassumed by Microchip Technology Incorporated with respectto the accuracy or use of such information, or infringement ofpatents or other intellectual property rights arising from suchuse or otherwise. Use of Microchip s products as criticalcomponents in life support systems is not authorized exceptwith express written approval by Microchip. No licenses areconveyed, implicitly or otherwise, under any intellectualproperty Microchip name and logo, the Microchip logo, Accuron, dsPIC, KEELOQ, microID, MPLAB, PIC, PICmicro, PICSTART, PRO MATE, PowerSmart, rfPIC, and SmartShunt are registered trademarks of Microchip Technology Incorporated in the and other , FilterLab, MXDEV, MXLAB, PICMASTER, SEEVAL, SmartSensor and The Embedded Control Solutions Company are registered trademarks of Microchip Technology Incorporated in the Age, Application Maestro, dsPICDEM, , dsPICworks, ECAN, ECONOMONITOR, FanSense, FlexROM, fuzzyLAB, In-Circuit Serial Programming, ICSP, ICEPIC, Migratable Memory, MPASM, MPLIB, MPLINK, MPSIM, PICkit, PICDEM, , PICLAB, PICtail, PowerCal, PowerInfo, PowerMate, PowerTool, rfLAB, rfPICDEM, Select Mode, Smart Serial.
2 SmartTel and Total Endurance are trademarks of Microchip Technology Incorporated in the and other is a service mark of Microchip Technology Incorporated in the other trademarks mentioned herein are property of their respective companies. 2004, Microchip Technology Incorporated, Printed in the , All Rights Reserved. Printed on recycled 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 Microchip s Data Sheets. Most likely, the person doing so is engaged in theft of intellectual property.
3 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 Microchip s 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 received ISO/TS-16949:2002 quality system certification for its worldwide headquarters, design and wafer fabrication facilities in Chandler and Tempe, Arizona and Mountain View, California in October 2003. The Company s quality system processes and procedures are for its PICmicro 8-bit MCUs, KEELOQ code hopping devices, Serial EEPROMs, microperipherals, nonvolatile memory and analog products.
4 In addition, Microchip s quality system for the design and manufacture of development systems is ISO 9001:2000 certified. 2004 Microchip Technology 1 PIC18F2420/2520/4420/4520 Power Managed Modes: Run: CPU on, peripherals on Idle: CPU off, peripherals on Sleep: CPU off, peripherals off Idle mode currents down to A typical Sleep mode current down to A typical Timer1 Oscillator: A, 32 kHz, 2V Watchdog Timer: A Two-Speed Oscillator Start-upPeripheral Highlights: High-current sink/source 25 mA/25 mA Three programmable external interrupts Four input change interrupts Up to 2 Capture/Compare/PWM (CCP) modules, one with Auto-Shutdown (28-pin devices) Enhanced Capture/Compare/PWM (ECCP) module (40/44-pin devices only):- One, two or four PWM outputs- Selectable polarity- Programmable dead time- Auto-Shutdown and Auto-Restart Master Synchronous Serial Port (MSSP) module supporting 3-wire SPI (all 4 modes) and I2C Master and Slave Modes Enhanced Addressable USART module.
5 - Supports RS-485, RS-232 and LIN RS-232 operation using internal oscillator block (no external crystal required)- Auto-Wake-up on Start bit- Auto-Baud Detect 10-bit, up to 13-channel Analog-to-Digital Converter module (A/D): - Auto-acquisition capability- Conversion available during Sleep Dual analog comparators with input multiplexing)Flexible Oscillator Structure: Four Crystal modes, up to 40 MHz 4X Phase Lock Loop (available for crystal and internal oscillators) Two External RC modes, up to 4 MHz Two External Clock modes, up to 40 MHz Internal oscillator block:- 8 user selectable frequencies, from 31 kHz to 8 MHz- Provides a complete range of clock speeds from 31 kHz to 32 MHz when used with PLL- User tunable to compensate for frequency drift Secondary oscillator using Timer1 @ 32 kHz Fail-Safe Clock Monitor:- Allows for safe shutdown if peripheral clock stopsSpecial Microcontroller Features: C compiler optimized architecture: - Optional extended instruction set designed to optimize re-entrant code 100,000 erase/write cycle Enhanced Flash program memory typical 1,000,000 erase/write cycle Data EEPROM memory typical Flash/Data EEPROM Retention: 100 years typical Self-programmable under software control Priority levels for interrupts 8 x 8 Single-Cycle Hardware Multiplier Extended Watchdog Timer (WDT):- Programmable period from 4 ms to 131s Single-supply 5V In-Circuit Serial Programming (ICSP ) via two pins In-Circuit Debug (ICD) via two pins Wide operating voltage range: to Programmable 16-level High/Low-Voltage Detection (HLVD) module.
6 - Supports interrupt on High/Low-Voltage Detection Programmable Brown-out Reset (BOR- With software enable option28/40/44-Pin Enhanced Flash Microcontrollers with10-Bit A/D and nanoWatt TechnologyPIC18F2420/2520/4420/4520DS396 31A-page 2 Preliminary 2004 Microchip Technology MemoryData MemoryI/O10-bitA/D (ch)CCP/ECCP(PWM) (bytes)# Single-WordInstructions SRAM(bytes)EEPROM(bytes)SPIM asterI2 CPIC18F242016K819276825625102/0YY121/3 PIC18F252032K16384153625625102/0YY121/3 PIC18F442016K819276825636131/1YY121/3 PIC18F452032K16384153625636131/1YY121/3 2004 Microchip Technology 3 PIC18F2420/2520/4420/4520 Pin Diagrams RB7/KBI3/PGDRB6/KBI2/PGCRB5/KBI1/PGMRB4/ KBI0/AN11RB3/AN9/CCP2(1)RB2/INT2/AN8RB1/ INT1/AN10RB0/INT0/FLT0/AN12 VDDVSSRD7/PSP7/P1 DRD6/PSP6/P1 CRD5/PSP5/P1 BRD4/PSP4RC7/RX/DTRC6/TX/CKRC5/SDORC4/SD I/SDARD3/PSP3RD2/PSP2 MCLR/VPP/RE3RA0/AN0RA1/AN1RA2/AN2/VREF-/ CVREFRA3/AN3/VREF+RA4/T0 CKI/C1 OUTRA5/AN4/SS/HLVDIN/C2 OUTRE0/RD/AN5RE1/WR/AN6RE2/CS/AN7 VDDVSSOSC1/CLKI/RA7 OSC2/CLKO/RA6RC0/T1 OSO/T13 CKIRC1/T1 OSI/CCP2(1)RC2/CCP1/P1 ARC3/SCK/SCLRD0/PSP0RD1/PSP1123456789101 1121314151617181920403938373635343332313 0292827262524232221 PIC18F4520 PIC18F2520101123456187912131415161718192 02324252627282221 MCLR/VPP/RE3RA0/AN0RA1/AN1RA2/AN2/VREF-/ CVREFRA3/AN3/VREF+RA4/T0 CKI/C1 OUTRA5/AN4/SS/HLVDIN/C2 OUTVSSOSC1/CLKI/RA7 OSC2/CLKO/RA6RC0/T1 OSO/T13 CKIRC1/T1 OSI/CCP2(1)RC2/CCP1RC3/SCK/SCLRB7/KBI3/P GDRB6//KBI2/PGCRB5/KBI1/PGMRB4/KBI0/AN11 RB3/AN9/CCP2(1)RB2/INT2/AN8RB1/INT1/AN10 RB0/INT0/FLT0/AN12 VDDVSSRC7/RX/DTRC6/TX/CKRC5/SDORC4/SDI/S DA40-pin PDIP28-pin PDIP, SOICPIC18F4420 PIC18F2420 Note 1.)
7 RB3 is the alternate pin for CCP2 112361181920212212 13 14158716172324252627289 PIC18F2420RC0/T1 OSO/T13 CKI54RB7/KBI3/PGDRB6/KBI2/PGCRB5/KBI1/PG MRB4 KBI0/AN11RB3/AN9/CCP2(1)RB2/INT2/AN8RB1/ INT1/AN10RB0/INT0/FLT0/AN12 VDDVSSRC7/RX/DTRC6/TX/CKRC5/SDORC4/SDI/S DAMCLR/VPP/RE3RA0/AN0RA1/AN1RA2/AN2/VREF -/CVREFRA3/AN3/VREF+RA4/T0 CKI/C1 OUTRA5/AN4/SS/HLVDIN/C2 OUTVSSOSC1/CLKI/RA7 OSC2/CLKO/RA6RC1/T1 OSI/CCP2(1)RC2/CCP1RC3/SCK/SCLPIC18F2520 28-pin QFNPIC18F2420/2520/4420/4520DS39631A-pag e 4 Preliminary 2004 Microchip Technology Diagrams (Cont. d) Note 1:RB3 is the alternate pin for CCP2 +RA2/AN2/VREF-/CVREFRA1/AN1RA0/AN0 MCLR/VPP/RE3RB3/AN9/CCP2(1)RB7/KBI3/PGDR B6/KBI2/PGCRB5/KBI1/PGMRB4/KBI0/AN11 NCRC6/TX/CKRC5/SDORC4/SDI/SDARD3/PSP3RD2 /PSP2RD1/PSP1RD0/PSP0RC3/SCK/SCLRC2/CCP1 /P1 ARC1/T1 OSI/CCP2(1)RC0/T1 OSO/T13 CKIOSC2/CLKO/RA6 OSC1/CLKI/RA7 VSSVSSVDDVDDRE2/CS/AN7RE1/WR/AN6RE0/RD/A N5RA5/AN4/SS/HLVDIN/C2 OUTRA4/T0 CKI/C1 OUTRC7/RX/DTRD4/PSP4RD5/PSP5/P1 BRD6/PSP6/P1 CRD7/PSP7/P1 DVSSVDDVDDRB0/INT0/FLT0/AN12RB1/INT1/AN1 0RB2/INT2/AN844-pin QFNPIC18F4520101123456118192021221213141 5388744434241403916172930313233232425262 7283634359 PIC18F442037RA3/AN3/VREF+RA2/AN2/VREF-/C VREFRA1/AN1RA0/AN0 MCLR/VPP/RE3 NCRB7/KBI3/PGDRB6/KBI2/PGCRB5/KBI1/PGMRB 4/KBI0/AN11 NCRC6/TX/CKRC5/SDORC4/SDI/SDARD3/PSP3RD2 /PSP2RD1/PSP1RD0/PSP0RC3/SCK/SCLRC2/CCP1 /P1 ARC1/T1 OSI/CCP2(1)
8 NCNCRC0/T1 OSO/T13 CKIOSC2/CLKO/RA6 OSC1/CLKI/RA7 VSSVDDRE2/CS/AN7RE1/WR/AN6RE0/RD/AN5RA5/ AN4/SS/HLVDIN/C2 OUTRA4/T0 CKI/C1 OUTRC7/RX/DTRD4/PSP4RD5/PSP5/P1 BRD6/PSP6/P1 CRD7/PSP7/P1 DVSSVDDRB0/INT0/FLT0/AN12RB1/INT1/AN10RB 2/INT2/AN8RB3/AN9/CCP2(1)44-pin TQFPPIC18F4520 2004 Microchip Technology 5 PIC18F2420/2520/4420/4520 Table of Overview .. Configurations .. Managed Modes .. Organization .. Program EEPROM Memory .. x 8 Hardware .. I/O Ports .. Timer0 Module .. Timer1 Module .. Timer2 Module .. Timer3 Module .. Capture/Compare/Pwm (CCP) Modules .. Enhanced Capture/Compare/PWM (ECCP) Master Synchronous Serial Port (MSSP) Module .. Enhanced Universal Synchronous Receiver Transmitter (EUSART) .. 10-Bit Analog-to-Digital Converter (A/D) Module .. Comparator Comparator Voltage Reference High/Low-Voltage Detect (HLVD).. Special Features of the Instruction Set Summary.
9 Development Electrical Characteristics .. DC and AC Characteristics Graphs and Packaging 363 Appendix A: Revision 371 Appendix B: Device Differences .. 371 Appendix C: Conversion Considerations .. 372 Appendix D: Migration from Baseline to Enhanced 372 Appendix E: Migration from Mid-Range to Enhanced Devices .. 373 Appendix F: Migration from High-End to Enhanced Devices .. 373 Index .. 375On-Line 385 Systems Information and Upgrade Hot Line .. 385 Reader Response .. 386 PIC18F2420/2520/4420/4520 Product Identification System .. 387 PIC18F2420/2520/4420/4520DS39631A-page 6 Preliminary 2004 Microchip Technology OUR VALUED CUSTOMERSIt is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchipproducts. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined andenhanced as new volumes and updates are introduced.
10 If you have any questions or comments regarding this publication, please contact the Marketing Communications Department viaE-mail at or fax the Reader Response Form in the back of this data Sheet to (480) welcome your Current Data SheetTo obtain the most up-to-date version of this data Sheet , please register at our Worldwide Web site at: can determine the version of a data Sheet by examining its literature number found on the bottom outside corner of any last character of the literature number is the version number, ( , DS30000A is version A of document DS30000).ErrataAn errata Sheet , describing minor operational differences from the data Sheet and recommended workarounds, may exist for currentdevices. As device/documentation issues become known to us, we will publish an errata Sheet . The errata will specify the revisionof silicon and revision of document to which it determine if an errata Sheet exists for a particular device, please check with one of the following: Microchip s Worldwide Web site; Your local Microchip sales office (see last page) The Microchip Corporate Literature Center; FAX: (480) 792-7277 When contacting a sales office or the literature center, please specify which device, revision of silicon and data Sheet (includeliterature number) you are Notification SystemRegister on our web site at to receive the most current information on all of our products.