PIC16F631/677/685/687/689/690 20-Pin Flash-Based, 8-Bit CMOS Microcontrollers High-Performance RISC CPU Low-Power Features Only 35 Instructions to Learn: Standby Current: - All single-cycle instructions except branches - 50 nA 2.0V, typical Operating Speed: Operating Current: - DC 20 MHz oscillator/clock input -11 A 32 kHz, 2.0V, typical - DC 200 ns instruction cycle -220 A 4 MHz, 2.0V, typical Interrupt Capability Watchdog Timer Current: 8-Level Deep Hardware Stack -<1 A 2.0V, typical Direct, Indirect and Relative Addressing modes Peripheral Features Special Microcontroller Features 17 I/O Pins and 1 Input-Only Pin: Precision Internal Oscillator: - High current source/sink for direct LED drive - Factory calibrated to 1% - Interrupt-on-Change pin - Software selectable frequency range of - Individually programmable weak pull-ups 8 MHz to 32 kHz - Ultra Low-Power Wake-up (ULPWU) - Software tunable Analog Comparator Module with: - Two-Speed Start-up mode - Two analog comparators - Crystal fail detect for critical applications - Programmable on-chip voltage reference - Clock mode switching during operation for (CVREF) module (% of VDD) power savings - Comparator inputs and outputs externally Power-Saving Sleep mode accessible Wide Operating Voltage Range (2.0V-5.5V) - SR Latch mode Industrial and Extended Temperature Range - Timer 1 Gate Sync Latch Power-on Reset (POR) - Fixed 0.6V VREF Power-up Timer (PWRTE) and Oscillator Start-up A/D Converter: Timer (OST) - 10-bit resolution and 12 channels Brown-out Reset (BOR) with Software Control Timer0: 8-Bit Timer/Counter with 8-Bit Option Programmable Prescaler Enhanced Low-Current Watchdog Timer (WDT) Enhanced Timer1: with On-Chip Oscillator (Software selectable - 16-bit timer/counter with prescaler nominal 268 Seconds with Full Prescaler) with - External Timer1 Gate (count enable) Software Enable - Option to use OSC1 and OSC2 in LP mode Multiplexed Master Clear/Input Pin as Timer1 oscillator if INTOSC mode Programmable Code Protection selected High Endurance Flash/EEPROM Cell: Timer2: 8-Bit Timer/Counter with 8-Bit Period - 100,000 write Flash endurance Register, Prescaler and Postscaler - 1,000,000 write EEPROM endurance Enhanced Capture, Compare, PWM+ Module: - Flash/Data EEPROM retention: > 40 years - 16-bit Capture, max resolution 12.5 ns Enhanced USART Module: - Compare, max resolution 200 ns - Supports RS-485, RS-232 and LIN 2.0 - 10-bit PWM with 1, 2 or 4 output channels, - Auto-Baud Detect programmable dead time, max frequency - Auto-wake-up on Start bit 20 kHz - PWM output steering control Synchronous Serial Port (SSP): - SPI mode (Master and Slave) 2 I C (Master/Slave modes): 2 -I C address mask TM TM In-Circuit Serial Programming (ICSP ) via Two Pins 2005-2015 Microchip Technology Inc. DS40001262F-page 1PIC16F631/677/685/687/689/690 Program Data Memory Memory 10-bit A/D Timers Device I/O Comparators SSP ECCP+ EUSART (ch) 8/16-bit Flash SRAM EEPROM (words) (bytes) (bytes) PIC16F631 1024 64 128 18 2 1/1 No No No PIC16F677 2048 128 256 18 12 2 1/1 Yes No No PIC16F685 4096 256 256 18 12 2 2/1 No Yes No PIC16F687 2048 128 256 18 12 2 1/1 Yes No Yes PIC16F689 4096 256 256 18 12 2 1/1 Yes No Yes PIC16F690 4096 256 256 18 12 2 2/1 Yes Yes Yes PIC16F631 Pin Diagram 20-pin PDIP, SOIC, SSOP VDD 1 20 VSS RA5/T1CKI/OSC1/CLKIN 2 19 RA0/C1IN+/ICSPDAT/ULPWU RA4/T1G/OSC2/CLKOUT 3 18 RA1/C12IN0-/ICSPCLK RA3/MCLR/VPP 4 RA2/T0CKI/INT/C1OUT 17 RC5 5 16 RC0/C2IN+ RC4/C2OUT 6 15 RC1/C12IN1- RC3/C12IN3- 7 14 RC2/C12IN2- RC6 8 13 RB4 RC7 9 12 RB5 RB7 10 11 RB6 TABLE 1: PIC16F631 PIN SUMMARY I/O Pin Analog Comparators Timers Interrupt Pull-up Basic RA0 19 AN0/ULPWU C1IN+ IOC Y ICSPDAT RA1 18 AN1 C12IN0- IOC Y ICSPCLK RA2 17 C1OUT T0CKI IOC/INT Y (1) RA3 4 IOC Y MCLR/VPP RA4 3 T1G IOC Y OSC2/CLKOUT RA5 2 T1CKI IOC Y OSC1/CLKIN RB4 13 IOC Y RB5 12 IOC Y RB6 11 IOC Y RB7 10 IOC Y RC0 16 AN4 C2IN+ RC1 15 AN5 C12IN1- RC2 14 AN6 C12IN2- RC3 7 AN7 C12IN3- RC4 6 C2OUT RC55 RC6 8 RC79 1 VDD 20 VSS Note 1: Pull-up enabled only with external MCLR configuration. DS40001262F-page 2 2005-2015 Microchip Technology Inc. PIC16F631