© 2009 Microchip Technology Inc. DS40044G
PIC16F627A/628A/648A
Data Sheet
Flash-Based, 8-Bit CMOS
Microcontrollers with nanoWatt Technology
DS40044G-page 2 © 2009 Microchip Technology Inc.
Information contained in this publication regarding device
applications and the like is provided only for your convenience
and may be superseded by updates. It is your responsibility to
ensure that your application meets with your specifications.
MICROCHIP MAKES NO REPRESENTATIONS OR
WARRANTIES OF ANY KIND WHETHER EXPRESS OR
IMPLIED, WRITTEN OR ORAL, STATUTORY OR
OTHERWISE, RELATED TO THE INFORMATION,
INCLUDING BUT NOT LIMITED TO ITS CONDITION,
QUALITY, PERFORMANCE, MERCHANTABILITY OR
FITNESS FOR PURPOSE. Microchip disclaims all liability
arising from this information and its use. Use of Microchip
devices in life support and/or safety applications is entirely at
the buyer’s risk, and the buyer agrees to defend, indemnify and
hold harmless Microchip from any and all damages, claims,
suits, or expenses resulting from such use. No licenses are
conveyed, implicitly or otherwise, under any Microchip
intellectual property rights.
Trademarks
The Microchip name and logo, the Microchip logo, dsPIC,
K
EELOQ, KEELOQ logo, MPLAB, PIC, PICmicro, PICSTART,
rfPIC and UNI/O are registered trademarks of Microchip
Technology Incorporated in the U.S.A. and other countries.
FilterLab, Hampshire, HI-TECH C, Linear Active Thermistor,
MXDEV, MXLAB, SEEVAL 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, HI-TIDE, In-Circuit Serial
Programming, ICSP, Mindi, MiWi, MPASM, MPLAB Certified
logo, MPLIB, MPLINK, mTouch, Octopus, Omniscient Code
Generation, PICC, PICC-18, PICDEM, PICDEM.net, PICkit,
PICtail, PIC
32
logo, REAL ICE, rfLAB, Select Mode, Total
Endurance, TSHARC, UniWinDriver, 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.
© 2009, 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 Microchip’s 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 our
products. Attempts to break Microchip’s code protection feature may be a violation of the Digital Millennium Copyright Act. If such acts
allow 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 Company’s 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, Microchip’s quality system for the design
and manufacture of development systems is ISO 9001:2000 certified.
© 2009 Microchip Technology Inc. DS40044G-page 3
PIC16F627A/628A/648A
High-Performance RISC CPU:
• Operating speeds from DC – 20 MHz
• Interrupt capability
• 8-level deep hardware stack
• Direct, Indirect and Relative Addressing modes
• 35 single-word instructions:
- All instructions single cycle except branches
Special Microcontroller Features:
• Internal and external oscillator options:
- Precision internal 4 MHz oscillator factory
calibrated to ±1%
- Low-power internal 48 kHz oscillator
- External Oscillator support for crystals and
resonators
• Power-saving Sleep mode
• Programmable weak pull-ups on PORTB
• Multiplexed Master Clear/Input-pin
• Watchdog Timer with independent oscillator for
reliable operation
• Low-voltage programming
• In-Circuit Serial Programming™ (via two pins)
• Programmable code protection
• Brown-out Reset
• Power-on Reset
• Power-up Timer and Oscillator Start-up Timer
• Wide operating voltage range (2.0-5.5V)
• Industrial and extended temperature range
• High-Endurance Flash/EEPROM cell:
- 100,000 write Flash endurance
- 1,000,000 write EEPROM endurance
- 40 year data retention
Low-Power Features:
• Standby Current:
- 100 nA @ 2.0V, typical
• Operating Current:
-12μA @ 32 kHz, 2.0V, typical
-120μA @ 1 MHz, 2.0V, typical
• Watchdog Timer Current:
-1μA @ 2.0V, typical
• Timer1 Oscillator Current:
-1.2μA @ 32 kHz, 2.0V, typical
• Dual-speed Internal Oscillator:
- Run-time selectable between 4 MHz and
48 kHz
-4μs wake-up from Sleep, 3.0V, typical
Peripheral Features:
• 16 I/O pins with individual direction control
• High current sink/source for direct LED drive
• Analog comparator module with:
- Two analog comparators
- Programmable on-chip voltage reference
(V
REF) module
- Selectable internal or external reference
- Comparator outputs are externally accessible
• Timer0: 8-bit timer/counter with 8-bit
programmable prescaler
• Timer1: 16-bit timer/counter with external crystal/
clock capability
• Timer2: 8-bit timer/counter with 8-bit period
register, prescaler and postscaler
• Capture, Compare, PWM module:
- 16-bit Capture/Compare
-10-bit PWM
• Addressable Universal Synchronous/Asynchronous
Receiver/Transmitter USART/SCI
Device
Program
Memory
Data Memory
I/O
CCP
(PWM)
USART Comparators
Timers
8/16-bit
Flash
(words)
SRAM
(bytes)
EEPROM
(bytes)
PIC16F627A 1024 224 128 16 1 Y 2 2/1
PIC16F628A 2048 224 128 16 1 Y 2 2/1
PIC16F648A 4096 256 256 16 1 Y 2 2/1
18-pin Flash-Based, 8-Bit CMOS Microcontrollers
with nanoWatt Technology
PIC16F627A/628A/648A
DS40044G-page 4 © 2009 Microchip Technology Inc.
Pin Diagrams
19
18
16
15
14
13
12
11
17
20
PDIP, SOIC
SSOP
27A/628A/648A
RA6/OSC2/CLKOUT
RA7/OSC1/CLKIN
V
SS
VSS
VDD
VDD
RA1/AN1
RA0/AN0
RB6/T1OSO/T1CKI/PGC
RB7/T1OSI/PGD
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
RB4/PGM
RB5
RA3/AN3/CMP1
RA4/T0CKI/CMP2
RA5/MCLR
/VPP
RB0/INT
RA2/AN2/V
REF
VSS
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
RA3/AN3/CMP1
RA4/T0CKI/CMP2
RA5/MCLR
/VPP
RB0/INT
RA2/AN2/V
REF
RA6/OSC2/CLKOUT
RA7/OSC1/CLKIN
V
DD
RA1/AN1
RA0/AN0
RB6/T1OSO/T1CKI/PGC
RB7/T1OSI/PGD
RB4/PGM
RB5
PIC16F627A/628A/648A
NC
NC
28
27
26
25
24
23
1
2
3
4
5
6
7
8
9
10
11
22
21
20
19
18
17
16
15
14
13
12
RA2/AN2/VREF
RA3/AN3/CMP1
RA4/T0CKI/CMP2
RA5/MCLR/VPP
VSS
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
RA1/AN1
RA0/AN0
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
RB7/T1OSI/PGD
RB6/T1OSO/T1CKI/PGC
RB5
VDD
RB4/PGM
VSS
NC
NC
NC
NC
NC
NC
V
DD
PIC16F627A/628A
PIC16F648A
28-Pin
QFN
2
3
4
5
6
7
8
9
118
17
15
14
13
12
11
10
16
2
3
4
5
6
7
8
9
10
1
PIC16F627A/628A/648A
© 2009 Microchip Technology Inc. DS40044G-page 5
PIC16F627A/628A/648A
Table of Contents
1.0 General Description ........................................................................................................................................................................ 7
2.0 PIC16F627A/628A/648A Device Varieties...................................................................................................................................... 9
3.0 Architectural Overview .................................................................................................................................................................. 11
4.0 Memory Organization .................................................................................................................................................................... 17
5.0 I/O Ports........................................................................................................................................................................................ 33
6.0 Timer0 Module .............................................................................................................................................................................. 47
7.0 Timer1 Module .............................................................................................................................................................................. 50
8.0 Timer2 Module .............................................................................................................................................................................. 54
9.0 Capture/Compare/PWM (CCP) Module........................................................................................................................................ 57
10.0 Comparator Module .................................................................................................................................................................... 63
11.0 Voltage Reference Module ......................................................................................................................................................... 69
12.0 Universal Synchronous Asynchronous Receiver Transmitter (USART) Module......................................................................... 73
13.0 Data EEPROM Memory .............................................................................................................................................................. 91
14.0 Special Features of the CPU ...................................................................................................................................................... 97
15.0 Instruction Set Summary........................................................................................................................................................... 117
16.0 Development Support ............................................................................................................................................................... 131
17.0 Electrical Specifications ............................................................................................................................................................ 135
18.0 DC and AC Characteristics Graphs and Tables ....................................................................................................................... 151
19.0 Packaging Information .............................................................................................................................................................. 163
Appendix A: Data Sheet Revision History......................................................................................................................................... 171
Appendix B: Device Differences ....................................................................................................................................................... 171
Appendix C: Device Migrations......................................................................................................................................................... 172
Appendix D: Migrating from other PIC
®
Devices .............................................................................................................................. 172
The Microchip Web Site .................................................................................................................................................................... 173
Customer Change Notification Service ............................................................................................................................................. 173
Customer Support ............................................................................................................................................................................. 173
Reader Response ............................................................................................................................................................................. 174
Product Identification System ........................................................................................................................................................... 179
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Micro-
chip products. To this end, we will continue to improve our publications to better suit your needs. Our publications will be refined
and enhanced as new volumes and updates are introduced.
If you have any questions or comments regarding this publication, please contact the Marketing Communications Department via
E-mail at docerrors@microchip.com or fax the Reader Response Form in the back of this data sheet to (480) 792-4150. We
welcome your feedback.
Most Current Data Sheet
To obtain the most up-to-date version of this data sheet, please register at our Worldwide Web site at:
http://www.microchip.com
You can determine the version of a data sheet by examining its literature number found on the bottom outside corner of any page.
The last character of the literature number is the version number, (e.g., DS30000A is version A of document DS30000).
Errata
An errata sheet, describing minor operational differences from the data sheet and recommended workarounds, may exist for current
devices. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revision
of silicon and revision of document to which it applies.
To determine if an errata sheet exists for a particular device, please check with one of the following:
• Microchip’s Worldwide Web site; http://www.microchip.com
• Your local Microchip sales office (see last page)
When contacting a sales office, please specify which device, revision of silicon and data sheet (include literature number) you are
using.
Customer Notification System
Register on our web site at www.microchip.com to receive the most current information on all of our products.