PIC18F87K22 Family
Data Sheet
64/80-Pin, High-Performance,
1-Mbit Enhanced Flash Microcontrollers
with 12-Bit A/D and
nanoWatt XLP Technology
2009-2011 Microchip Technology Inc.
DS39960D
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.
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
EE
L
OQ
, K
EE
L
OQ
logo, MPLAB, PIC, PICmicro, PICSTART,
PIC
32
logo, 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, chipKIT,
chipKIT logo, 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, Omniscient Code Generation, PICC,
PICC-18, PICDEM, PICDEM.net, PICkit, PICtail, 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-2011, Microchip Technology Incorporated, Printed in
the U.S.A., All Rights Reserved.
Printed on recycled paper.
ISBN: 978-1-61341-272-5
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, K
EE
L
OQ
®
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.
DS39960D-page 2
2009-2011 Microchip Technology Inc.
PIC18F87K22 FAMILY
64/80-Pin, High-Performance, 1-Mbit Enhanced Flash MCUs
with 12-Bit A/D and nanoWatt XLP Technology
Low-Power Features:
• Power-Managed modes:
- Run: CPU on, peripherals on
- Idle: CPU off, peripherals on
- Sleep: CPU off, peripherals off
• Two-Speed Oscillator Start-up
• Fail-Safe Clock Monitor
• Power-Saving Peripheral Module Disable (PMD)
• Ultra Low-Power Wake-up
• Fast Wake-up, 1
s
Typical
• Low-Power WDT, 300 nA Typical
• Ultra Low 50 nA Input Leakage
• Run mode Currents Down to 5.5
A,
Typical
• Idle mode Currents Down to 1.7
A
Typical
• Sleep mode Currents Down to Very Low 20 nA,
Typical
• RTCC Current Downs to Very Low 700 nA,
Typical
Special Microcontroller Features:
•
•
•
•
•
•
•
•
•
•
Operating Voltage Range: 1.8V to 5.5V
On-Chip 3.3V Regulator
Operating Speed up to 64 MHz
Up to 128 Kbytes On-Chip Flash Program
Memory
Data EEPROM of 1,024 Bytes
4K x 8 General Purpose Registers (SRAM)
10,000 Erase/Write Cycle Flash Program
Memory, Minimum
1,000,000 Erase/write Cycle Data EEPROM
Memory, Typical
Flash Retention: 40 Years, Minimum
Three Internal Oscillators: LF-INTRC (31 kHz),
MF-INTOSC (500 kHz) and HF-INTOSC
(16 MHz)
Self-Programmable under Software Control
Priority Levels for Interrupts
8 x 8 Single-Cycle Hardware Multiplier
Extended Watchdog Timer (WDT):
- Programmable period from 4 ms to 4,194s
(about 70 minutes)
In-Circuit Serial Programming™ (ICSP™) via
Two Pins
In-Circuit Debug via Two Pins
Programmable:
- BOR
- LVD
•
•
•
•
•
•
•
Comparators
EUSART
Device
Flash # Single-Word SRAM EEPROM
(bytes) Instructions (bytes) (bytes)
32K
64K
128K
32K
64K
128K
16,383
32,768
65,536
16,383
32,768
65,536
2K
4K
4K
2K
4K
4K
1K
1K
1K
1K
1K
1K
I/O
12-Bit CCP/
A/D ECCP
(ch) (PWM)
16
16
16
24
24
24
5/3
7/3
7/3
5/3
7/3
7/3
2
2
2
2
2
2
Timers
8/16-Bit
Program Memory
Data Memory
MSSP
SPI
Y
Y
Y
Y
Y
Y
Master
I
2
C™
Y
Y
Y
Y
Y
Y
External Bus
CTMU
Y
Y
Y
Y
Y
Y
PIC18F65K22
PIC18F66K22
PIC18F67K22
PIC18F85K22
PIC18F86K22
PIC18F87K22
53
53
53
69
69
69
2
2
2
2
2
2
3
3
3
3
3
3
4/4
6/5
6/5
4/4
6/5
6/5
N
N
N
Y
Y
Y
2009-2011 Microchip Technology Inc.
DS39960D-page 3
RTCC
Y
Y
Y
Y
Y
Y
PIC18F87K22 FAMILY
Peripheral Highlights:
• Up to Ten CCP/ECCP modules:
- Up to seven Capture/Compare/PWM (CCP)
modules
- Three Enhanced Capture/Compare/PWM
(ECCP) modules
• Up to Eleven 8/16-Bit Timer/Counter modules:
- Timer0 – 8/16-bit timer/counter with 8-bit
programmable prescaler
- Timer1,3 – 16-bit timer/counter
- Timer2,4,6,8 – 8-bit timer/counter
- Timer5,7 – 16-bit timer/counter for 64k and
128k parts
- Timer10,12 – 8-bit timer/counter for 64k and
128k parts
• Three Analog Comparators
• Configurable Reference Clock Output
• Hardware Real-Time Clock and Calendar (RTCC)
module with Clock, Calendar and Alarm Functions
• Charge Time Measurement Unit (CTMU):
- Capacitance measurement for mTouch™
sensing solution
- Time measurement with 1 ns typical
resolution
- Integrated temperature sensor
• High-Current Sink/Source 25 mA/25 mA
(PORTB and PORTC)
• Up to Four External Interrupts
• Two Master Synchronous Serial Port (MSSP)
modules:
- 3/4-wire SPI (supports all four SPI modes)
- I
2
C™ Master and Slave modes
• Two Enhanced Addressable USART modules:
- LIN/J2602 support
- Auto-Baud Detect (ABD)
• 12-Bit A/D Converter with up to 24 Channels:
- Auto-acquisition and Sleep operation
- Differential input mode of operation
• Integrated Voltage Reference
DS39960D-page 4
2009-2011 Microchip Technology Inc.
PIC18F87K22 FAMILY
Pin Diagrams – PIC18F6XK22
64-Pin TQFP, QFN
RE3/P3C/CCP9
(2)
/REF0
RD0/PSP0/CTPLS
RE7/ECCP2/P2A
RE5/P1C/CCP7
RE4/P3B/CCP8
RE6/P1B/CCP6
RD6/PSP6/SCK2/SCL2
RE2/CS/P2B/CCP10
(2)
RD5/PSP5/SDI2/SDA2
RD1/PSP1/T5CKI/T7G
RD4/PSP4/SDO2
V
DD
64 63 62 61 60 59 58 57 56 55 54 53 52 51 50 49
RE1/WR/P2C
RE0/RD/P2D
RG0/ECCP3/P3A
RG1/TX2/CK2/AN19/C3OUT
RG2/RX2/DT2/AN18/C3INA
RG3/CCP4/AN17/P3D/C3INB
MCLR/RG5
RG4/RTCC/T7CKI
(2)
/T5G/CCP5/AN16/P1D/C3INC
V
SS
V
DDCORE
/V
CAP
RF7/AN5/SS1
RF6/AN11/C1INA
RF5/AN10/CV
REF
/C1INB
RF4/AN9/C2INA
RF3/AN8/C2INB/CTMUI
RF2/AN7/C1OUT
RD7/PSP7/SS2
RD2/PSP2
RD3/PSP3
V
SS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
48
47
46
45
44
43
RB0/INT0/FLT0
RB1/INT1
RB2/INT2/CTED1
RB3/INT3/CTED2/ECCP2
(1)
/PA2
RB4/KBI0
RB5/KBI1/T3CKI/T1G
RB6/KBI2/PGC
V
SS
OSC2/CLKO/RA6
OSC1/CLKI/RA7
V
DD
RB7/KBI3/PGD
RC5/SDO1
RC4/SDI1/SDA1
RC3/SCK1/SCL1
RC2/ECCP1/P1A
PIC18F65K22
PIC18F66K22
PIC18F67K22
42
41
40
39
38
37
36
35
34
33
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
AV
DD
V
DD
RA5/AN4/T1CKI/T3G/HLVDIN
RF1/AN6/C2OUT/CTDIN
RA4/T0CKI
RC1/SOSCI/ECCP2
(1)
/P2A
RC6/TX1/CK1
RA1/AN1
Note 1:
2:
The ECCP2 pin placement depends on the CCP2MX Configuration bit setting and whether the device is
in Microcontroller or Extended Microcontroller mode.
Not available on the PIC18F65K22 and PIC18F85K22 devices.
2009-2011 Microchip Technology Inc.
RC0/SOSCO/SCLKI
RA2/AN2/V
REF
-
RA0/AN0/ULPWU
AV
SS
RA3/AN3/V
REF
+
RC7/RX1/DT1
ENVREG
V
SS
DS39960D-page 5