PIC16F62X
FLASH-Based 8-Bit CMOS Microcontrollers
Devices included in this data sheet:
• PIC16F627
• PIC16F628
Referred to collectively as PIC16F62X .
Special Microcontroller Features:
• Power-on Reset (POR)
• Power-up Timer (PWRT) and Oscillator Start-up
Timer (OST)
• Brown-out Detect (BOD)
• Watchdog Timer (WDT) with its own on-chip RC
oscillator for reliable operation
• Multiplexed MCLR-pin
• Programmable weak pull-ups on PORTB
• Programmable code protection
• Low voltage programming
• Power saving SLEEP mode
• Selectable oscillator options
- FLASH configuration bits for oscillator options
- ER (External Resistor) oscillator
- Reduced part count
- Dual speed INTRC
- Lower current consumption
- EC External Clock input
- XT oscillator mode
- HS oscillator mode
- LP oscillator mode
• Serial in-circuit programming (via two pins)
• Four user programmable ID locations
High Performance RISC CPU:
• Only 35 instructions to learn
• All single-cycle instructions (200 ns), except for
program branches which are two-cycle
• Operating speed:
- DC - 20 MHz clock input
- DC - 200 ns instruction cycle
Memory
Device
PIC16F627
PIC16F628
FLASH
Program
1024 x 14
2048 x 14
RAM
Data
224 x 8
224 x 8
EEPROM
Data
128 x 8
128 x 8
•
•
•
•
Interrupt capability
16 special function hardware registers
8-level deep hardware stack
Direct, Indirect and Relative addressing modes
Peripheral Features:
• 15 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
- Programmable input multiplexing from device
inputs and internal voltage 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 regis-
ter, prescaler and postscaler
• Capture, Compare, PWM (CCP) module
- Capture is 16-bit, max. resolution is 12.5 ns
- Compare is 16-bit, max. resolution is 200 ns
- PWM max. resolution is 10-bit
• Universal Synchronous/Asynchronous Receiver/
Transmitter USART/SCI
• 16 Bytes of common RAM
CMOS Technology:
• Low-power, high-speed CMOS FLASH technology
• Fully static design
• Wide operating voltage range
- PIC16F627 - 3.0V to 5.5V
- PIC16F628 - 3.0V to 5.5V
- PIC16LF627 - 2.0V to 5.5V
- PIC16LF628 - 2.0V to 5.5V
• Commercial, industrial and extended temperature
range
• Low power consumption
- < 2.0 mA @ 5.0V, 4.0 MHz
- 15
µA
typical @ 3.0V, 32 kHz
- < 1.0
µA
typical standby current @ 3.0V
©
1999 Microchip Technology Inc.
Preliminary
DS40300B-page 1
PIC16F62X
Pin Diagrams
PDIP, SOIC
RA2/AN2/V
REF
RA3/AN3/CMP1
RA4/TOCKI/CMP2
RA5/MCLR/THV
V
SS
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
•1
2
3
4
5
6
7
8
9
18
17
16
15
14
13
12
11
10
RA1/AN1
RA0/AN0
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
V
DD
RB7/T1OSI
RB6/T1OSO/T1CKI
RB5
RB4/PGM
PIC16F62X
SSOP
RA2/AN2/V
REF
RA3/AN3/CMP1
RA4/TOCKI/CMP2
RA5/MCLR/THV
V
SS
V
SS
RB0/INT
RB1/RX/DT
RB2/TX/CK
RB3/CCP1
•1
2
3
4
5
6
7
8
9
10
20
19
18
17
16
15
14
13
12
11
RA1/AN1
RA0/AN0
RA7/OSC1/CLKIN
RA6/OSC2/CLKOUT
V
DD
V
DD
RB7/T1OSI
RB6/T1OSO/T1CKI
RB5
RB4/PGM
PIC16F62X
Device Differences
Device
PIC16F627
PIC16F628
PIC16LF627
PIC16LF628
Voltage
Range
3.0 - 5.5
3.0 - 5.5
2.0 - 5.5
2.0 - 5.5
Oscillator
See Note 1
See Note 1
See Note 1
See Note 1
Process
Technology
(Microns)
0.7
0.7
0.7
0.7
Note 1:
If you change from this device to another device, please verify oscillator characteristics in your application.
DS40300B-page 2
Preliminary
©
1999 Microchip Technology Inc.
PIC16F62X
Table of Contents
1.0
General Description..................................................................................................................................................................... 5
2.0
PIC16F62X Device Varieties...................................................................................................................................................... 7
3.0
Architectural Overview ................................................................................................................................................................ 9
4.0
Memory Organization ................................................................................................................................................................ 13
5.0
I/O Ports .................................................................................................................................................................................... 27
6.0
Timer0 Module .......................................................................................................................................................................... 45
7.0
Timer1 Module .......................................................................................................................................................................... 50
8.0
Timer2 Module .......................................................................................................................................................................... 54
9.0
Comparator Module................................................................................................................................................................... 57
10.0 Capture/Compare/PWM (CCP) Module .................................................................................................................................... 63
11.0 Voltage Reference Module........................................................................................................................................................ 69
12.0 Universal Synchronous Asynchronous Receiver Transmitter (USART).................................................................................... 71
13.0 Data EEPROM Memory ............................................................................................................................................................ 91
14.0 Special Features of the CPU..................................................................................................................................................... 95
15.0 Instruction Set Summary ......................................................................................................................................................... 113
16.0 Development Support.............................................................................................................................................................. 125
17.0 Electrical Specifications........................................................................................................................................................... 131
18.0 Device Characterization Information ....................................................................................................................................... 145
19.0 Packaging Information............................................................................................................................................................. 147
Index .................................................................................................................................................................................................. 151
On-Line Support................................................................................................................................................................................. 155
Reader Response .............................................................................................................................................................................. 156
PIC16F62X Product Identification System ........................................................................................................................................ 157
To Our Valued Customers
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.
New Customer Notification System
Register on our web site (www.microchip.com/cn) to receive the most current information on our products.
Errata
An errata sheet may exist for current devices, describing minor operational differences (from the data sheet) and recommended
workarounds. As device/documentation issues become known to us, we will publish an errata sheet. The errata will specify the revi-
sion 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)
• The Microchip Corporate Literature Center; U.S. FAX: (602) 786-7277
When contacting a sales office or the literature center, please specify which device, revision of silicon and data sheet (include liter-
ature number) you are using.
Corrections to this Data Sheet
We constantly strive to improve the quality of all our products and documentation. We have spent a great deal of time to ensure
that this document is correct. However, we realize that we may have missed a few things. If you find any information that is missing
or appears in error, please:
• Fill out and mail in the reader response form in the back of this data sheet.
• E-mail us at webmaster@microchip.com.
We appreciate your assistance in making this a better document.
©
1999 Microchip Technology Inc.
Preliminary
DS40300B-page 3
PIC16F62X
NOTES:
DS40300B-page 4
Preliminary
©
1999 Microchip Technology Inc.
PIC16F62X
1.0
GENERAL DESCRIPTION
1.1
Development Support
The PIC16F62X are 18-Pin FLASH-based members of
the versatile PIC16CXX family of low-cost,
high-performance,
CMOS,
fully-static,
8-bit
microcontrollers.
All PICmicro
®
microcontrollers employ an advanced
RISC architecture. The PIC16F62X have enhanced
core features, eight-level deep stack, and multiple inter-
nal and external interrupt sources. The separate
instruction and data buses of the Harvard architecture
allow a 14-bit wide instruction word with the separate
8-bit wide data. The two-stage instruction pipeline
allows all instructions to execute in a single-cycle,
except for program branches (which require two
cycles). A total of 35 instructions (reduced instruction
set) are available. Additionally, a large register set gives
some of the architectural innovations used to achieve a
very high performance.
PIC16F62X microcontrollers typically achieve a 2:1
code compression and a 4:1 speed improvement over
other 8-bit microcontrollers in their class.
PIC16F62X devices have special features to reduce
external components, thus reducing system cost,
enhancing system reliability and reducing power con-
sumption. There are eight oscillator configurations, of
which the single pin ER oscillator provides a low-cost
solution. The LP oscillator minimizes power consump-
tion, XT is a standard crystal, INTRC is a self-contained
internal oscillator and the HS is for High Speed crys-
tals. The SLEEP (power-down) mode offers power sav-
ings. The user can wake up the chip from SLEEP
through several external and internal interrupts and
reset.
A highly reliable Watchdog Timer with its own on-chip
RC oscillator provides protection against software
lock- up.
Table 1-1 shows the features of the PIC16F62X
mid-range microcontroller families.
A simplified block diagram of the PIC16F62X is shown
in Figure 3-1.
The PIC16F62X series fits in applications ranging from
battery chargers to low-power remote sensors. The
FLASH technology makes customization of application
programs (detection levels, pulse generation, timers,
etc.) extremely fast and convenient. The small footprint
packages make this microcontroller series ideal for all
applications with space limitations. Low-cost,
low-power, high-performance, ease of use and I/O flex-
ibility make the PIC16F62X very versatile.
The PIC16F62X family is supported by a full-featured
macro assembler, a software simulator, an in-circuit
emulator, a low-cost development programmer and a
full-featured programmer. A Third Party “C” compiler
support tool is also available.
©
1999 Microchip Technology Inc.
Preliminary
DS40300B-page 5