PIC18F6520/8520/6620/ 8620/6720/8720 64/80-Pin High-Performance, 256 Kbit to 1 Mbit Enhanced Flash Microcontrollers with A/D High-Performance RISC CPU: Analog Features: C compiler optimized architecture/instruction set: 10-bit, up to 16-channel Analog-to-Digital Converter (A/D): - Source code compatible with the PIC16 and PIC17 instruction sets - Conversion available during Sleep Linear program memory addressing to 128 Kbytes Programmable 16-level Low-Voltage Detection (LVD) module: Linear data memory addressing to 3840 bytes - Supports interrupt on Low-Voltage Detection 1 Kbyte of data EEPROM Programmable Brown-out Reset (PBOR) Up to 10 MIPs operation: Dual analog comparators: - DC 40 MHz osc./clock input - 4 MHz 10 MHz osc./clock input with PLL active - Programmable input/output configuration 16-bit wide instructions, 8-bit wide data path Special Microcontroller Features: Priority levels for interrupts 100,000 erase/write cycle Enhanced Flash 31-level, software accessible hardware stack program memory typical 8 x 8 Single Cycle Hardware Multiplier 1,000,000 erase/write cycle Data EEPROM External Memory Interface memory typical (PIC18F8X20 Devices Only): 1 second programming time Flash/Data EEPROM Retention: > 40 years Address capability of up to 2 Mbytes Self-reprogrammable under software control 16-bit interface Power-on Reset (POR), Power-up Timer (PWRT) Peripheral Features: and Oscillator Start-up Timer (OST) High current sink/source 25 mA/25 mA Watchdog Timer (WDT) with its own On-Chip Four external interrupt pins RC Oscillator for reliable operation Timer0 module: 8-bit/16-bit timer/counter Programmable code protection Timer1 module: 16-bit timer/counter Power saving Sleep mode Timer2 module: 8-bit timer/counter Selectable oscillator options including: Timer3 module: 16-bit timer/counter - 4X Phase Lock Loop (of primary oscillator) Timer4 module: 8-bit timer/counter - Secondary Oscillator (32 kHz) clock input Secondary oscillator clock option Timer1/Timer3 In-Circuit Serial Programming (ICSP) via two pins Five Capture/Compare/PWM (CCP) modules: MPLAB In-Circuit Debug (ICD) via two pins - Capture is 16-bit, max. resolution 6.25 ns (TCY/16) - Compare is 16-bit, max. resolution 100 ns (TCY) CMOS Technology: - PWM output: PWM resolution is 1 to 10-bit Low-power, high-speed Flash technology Master Synchronous Serial Port (MSSP) module Fully static design with two modes of operation: Wide operating voltage range (2.0V to 5.5V) - 3-wire SPI (supports all 4 SPI modes) 2 Industrial and Extended temperature ranges -I C Master and Slave mode Two Addressable USART modules: - Supports RS-485 and RS-232 Parallel Slave Port (PSP) module Program Memory Data Memory MSSP 10-bit Max CCP Timers Ext Device I/O A/D USART FOSC Single-Word SRAM EEPROM Master (PWM) 8-bit/16-bit Bus Bytes SPI (ch) 2 (MHz) Instructions (bytes) (bytes) I C PIC18F6520 32K 16384 2048 1024 52 12 5 Y Y 2 2/3 N 40 PIC18F6620 64K 32768 3840 1024 52 12 5 Y Y 2 2/3 N 25 PIC18F6720 128K 65536 3840 1024 52 12 5 Y Y 2 2/3 N 25 PIC18F8520 32K 16384 2048 1024 68 16 5 Y Y 2 2/3 Y 40 PIC18F8620 64K 32768 3840 1024 68 16 5 Y Y 2 2/3 Y 25 PIC18F8720 128K 65536 3840 1024 68 16 5 Y Y 2 2/3 Y 25 2003-2013 Microchip Technology Inc. DS39609C-page 1PIC18F6520/8520/6620/8620/6720/8720 Pin Diagrams 64-Pin TQFP 48 RB0/INT0 RE1/WR 1 RB1/INT1 RE0/RD 47 2 RG0/CCP3 46 RB2/INT2 3 RG1/TX2/CK2 RB3/INT3 4 45 RG2/RX2/DT2 RB4/KBI0 5 44 RG3/CCP4 6 43 RB5/KBI1/PGM RB6/KBI2/PGC MCLR/VPP 7 42 PIC18F6520 RG4/CCP5 8 41 VSS PIC18F6620 VSS 9 40 OSC2/CLKO/RA6 PIC18F6720 VDD OSC1/CLKI 10 39 RF7/SS 11 38 VDD RF6/AN11 RB7/KBI3/PGD 12 37 RF5/AN10/CVREF RC5/SDO 13 36 RC4/SDI/SDA RF4/AN9 14 35 RF3/AN8 RC3/SCK/SCL 15 34 RF2/AN7/C1OUT RC2/CCP1 16 33 Note 1: CCP2 is multiplexed with RC1 when CCP2MX is set. DS39609C-page 2 2003-2013 Microchip Technology Inc. 17 64 RF1/AN6/C2OUT RE2/CS 18 RF0/AN5 63 RE3 19 AVDD 62 RE4 20 AVSS RE5 61 21 RA3/AN3/VREF+ RE6 60 (1) 22 RA2/AN2/VREF- RE7/CCP2 59 23 RA1/AN1 RD0/PSP0 58 24 VDD RA0/AN0 57 25 VSS 56 VSS 26 VDD 55 RD1/PSP1 27 RA5/AN4/LVDIN 54 RD2/PSP2 28 RA4/T0CKI 53 RD3/PSP3 (1) RC1/T1OSI/CCP2 29 52 RD4/PSP4 RC0/T1OSO/T13CKI 30 RD5/PSP5 51 RC6/TX1/CK1 31 50 RD6/PSP6 RC7/RX1/DT1 32 49 RD7/PSP7