PIC18F1220/1320 18/20/28-Pin High-Performance, Enhanced Flash MCUs with 10-bit A/D Low-Power Features Peripheral Highlights Power Managed modes: High Current Sink/Source 25 mA/25 mA - Run: CPU on, peripherals on Three External Interrupts - Idle: CPU off, peripherals on Enhanced Capture/Compare/PWM (ECCP) module: - Sleep: CPU off, peripherals off - One, two or four PWM outputs Power Consumption modes: - Selectable polarity - PRI RUN: 150 A, 1 MHz, 2V - Programmable dead time - PRI IDLE: 37 A, 1 MHz, 2V - Auto-Shutdown and Auto-Restart - SEC RUN: 14 A, 32 kHz, 2V - Capture is 16-bit, max resolution 6.25 ns (TCY/16) - SEC IDLE: 5.8 A, 32 kHz, 2V - Compare is 16-bit, max resolution 100 ns (TCY) - RC RUN: 110 A, 1 MHz, 2V Compatible 10-bit, up to 13-Channel Analog-to- Digital Converter module (A/D) with Programmable - RC IDLE: 52 A, 1 MHz, 2V Acquisition Time - Sleep: 0.1 A, 1 MHz, 2V Enhanced USART module: Timer1 Oscillator: 1.1 A, 32 kHz, 2V - Supports RS-485, RS-232 and LIN 1.2 Watchdog Timer: 2.1 A - Auto-Wake-up on Start bit Two-Speed Oscillator Start-up - Auto-Baud Detect Oscillators Special Microcontroller Features Four Crystal modes: 100,000 Erase/Write Cycle Enhanced Flash - LP, XT, HS: up to 25 MHz Program Memory, typical - HSPLL: 4-10 MHz (16-40 MHz internal) 1,000,000 Erase/Write Cycle Data EEPROM Two External RC modes, up to 4 MHz Memory, typical Two External Clock modes, up to 40 MHz Flash/Data EEPROM Retention: > 40 years Internal Oscillator Block: Self-Programmable under Software Control - 8 user-selectable frequencies: 31 kHz, 125 kHz, Priority Levels for Interrupts 250 kHz, 500 kHz, 1 MHz, 2 MHz, 4 MHz, 8 MHz 8 x 8 Single-Cycle Hardware Multiplier - 125 kHz to 8 MHz calibrated to 1% Extended Watchdog Timer (WDT): - Two modes select one or two I/O pins - Programmable period from 41 ms to 131s - OSCTUNE Allows user to shift frequency - 2% stability over VDD and Temperature Secondary Oscillator using Timer1 32 kHz Single-Supply 5V In-Circuit Serial Programming Fail-Safe Clock Monitor (ICSP) via Two Pins - Allows for safe shutdown if peripheral clock stops In-Circuit Debug (ICD) via Two Pins Wide Operating Voltage Range: 2.0V to 5.5V Program Memory Data Memory 10-bit ECCP Timers Device I/O EUSART Flash Single-Word SRAM EEPROM A/D (ch) (PWM) 8/16-bit (bytes) Instructions (bytes) (bytes) PIC18F1220 4K 2048 256 256 16 7 1 Y 1/3 PIC18F1320 8K 4096 256 256 16 7 1 Y 1/3 2002-2015 Microchip Technology Inc. DS30009605G-page 1PIC18F1220/1320 Pin Diagrams 20-Pin SSOP 18-Pin PDIP, SOIC RA0/AN0 1 20 RB3/CCP1/P1A RA0/AN0 1 18 RB3/CCP1/P1A RA1/AN1/LVDIN 2 19 RB2/P1B/INT2 RA1/AN1/LVDIN 2 17 RB2/P1B/INT2 RA4/T0CKI 3 18 OSC1/CLKI/RA7 RA4/T0CKI 3 16 OSC1/CLKI/RA7 MCLR/VPP/RA5 MCLR/VPP/RA5 4 17 OSC2/CLKO/RA6 4 15 OSC2/CLKO/RA6 VSS VDD 5 16 VSS/AVSS 5 14 VDD/AVDD AVSS AVDD RB7/PGD/T1OSI/ 615 RA2/AN2/VREF- 6 13 P1D/KBI3 RB7/PGD/T1OSI/ RA2/AN2/VREF- 7 14 RB6/PGC/T1OSO/ P1D/KBI3 RA3/AN3/VREF+ 7 12 T13CKI/P1C/KBI2 RB6/PGC/T1OSO/ RA3/AN3/VREF+ 8 13 8 11 RB0/AN4/INT0 RB5/PGM/KBI1 T13CKI/P1C/KBI2 RB1/AN5/TX/ RB4/AN6/RX/ RB5/PGM/KBI1 9 10 RB0/AN4/INT0 9 12 CK/INT1 DT/KBI0 RB4/AN6/RX/ RB1/AN5/TX/ 10 11 DT/KBI0 CK/INT1 28-Pin QFN MCLR/VPP/RA5 1 21 OSC1/CLKI/RA7 2 20 OSC2/CLKO/RA6 NC 3 19 VSS VDD 18 NC 4 PIC18F1X20 NC 17 5 AVDD AVSS 16 6 RB7/PGD/T1OSI/P1D/KBI3 NC 7 15 RB6/PGC/T1OSO/T13CKI/P1C/KBI2 RA2/AN2/VREF- DS30009605G-page 2 2002-2015 Microchip Technology Inc. PIC18F1X20 8 RA3/AN3/VREF+ RA4/T0CKI 28 RB0/AN4/INT0 9 RA1/AN1/LVDIN 27 RB1/AN5/TX/CK/INT1 10 RA0/AN0 26 NC 11 25 NC RB4/AN6/RX/DT/KBI0 12 24 RB3/CCP1/P1A RB5/PGM/KBI1 13 23 RB2/P1B/INT2 NC 14 NC 22 PIC18F1X20