This document is a data sheet that provides details about Microchip's PIC16F87XA family of microcontrollers. It includes specifications for the 28/40/44-pin PIC16F873A, PIC16F874A, PIC16F876A, and PIC16F877A devices. The summary highlights the devices' features such as their RISC CPU, analog and timing peripherals, memory sizes, and programming options. Pin diagrams and a table comparing the devices are also included.
Maharastra University electronics and Telecommunication Department NetSim (http://www.tetcos.com/ ) Experiment Manual , which can be done using NetSim Simulator , follow this Link :http://www.tetcos.com/
Complete description of AT89xxx (8051 based) microcontrollers with timers, serial communication and assembly language programming. Interfacing of some real time devices like led, sensor, and seven segment display is also covered.
Hi, im Perlis polytechnic student, and now i undergo last semester already. And i taken one interesting subject is CMOS IC design. So this is one of lab work that i uploading. Using L-Edit to design NAND gate.
In this presentation we can learn about basic concept of Instruction set, Byte Oriented Instructions, Bit Oriented instructions, Literal Instructions clearly.
Interconnects occupy upto 90% of the area in Reconfigurable Architectures and affect the speed and noise of the chip. This presentations gives briefs about interconnects, particularly in context of Reconfigurable Architecture (eg FPGAs)
Maharastra University electronics and Telecommunication Department NetSim (http://www.tetcos.com/ ) Experiment Manual , which can be done using NetSim Simulator , follow this Link :http://www.tetcos.com/
Complete description of AT89xxx (8051 based) microcontrollers with timers, serial communication and assembly language programming. Interfacing of some real time devices like led, sensor, and seven segment display is also covered.
Hi, im Perlis polytechnic student, and now i undergo last semester already. And i taken one interesting subject is CMOS IC design. So this is one of lab work that i uploading. Using L-Edit to design NAND gate.
In this presentation we can learn about basic concept of Instruction set, Byte Oriented Instructions, Bit Oriented instructions, Literal Instructions clearly.
Interconnects occupy upto 90% of the area in Reconfigurable Architectures and affect the speed and noise of the chip. This presentations gives briefs about interconnects, particularly in context of Reconfigurable Architecture (eg FPGAs)
A digital clock is a type of clock that displays the time digitally (i.e. in numerals or other symbols), as opposed to an analog clock, where the time is indicated by the positions of rotating hands.
Presentation On: "Micro-controller 8051 & Embedded System"surabhii007
The presentation is dealing with majors about 'An Embedded System' along with 'Micro-controller' with it's base peripherals & parameters.
Hope It'll be helpfull!
Semiconductor Memory Fundamentals
Memory Types
Memory Structure and its requirements
Memory Decoding
Examples
Input - Output Interfacing
Types of Parallel Data Transfer or I/O Techniques
TÉCNICAS DE PROGRAMACIÓN EN ENSAMBLADOR
Conjunto de Instrucciones
SET DE 35 INSTRUCCIONES
CONJUNTO DE INSTRUCCIONES PROGRAMACIÓN EN ASSEMBLER PARA PIC16F877A
A digital clock is a type of clock that displays the time digitally (i.e. in numerals or other symbols), as opposed to an analog clock, where the time is indicated by the positions of rotating hands.
Presentation On: "Micro-controller 8051 & Embedded System"surabhii007
The presentation is dealing with majors about 'An Embedded System' along with 'Micro-controller' with it's base peripherals & parameters.
Hope It'll be helpfull!
Semiconductor Memory Fundamentals
Memory Types
Memory Structure and its requirements
Memory Decoding
Examples
Input - Output Interfacing
Types of Parallel Data Transfer or I/O Techniques
TÉCNICAS DE PROGRAMACIÓN EN ENSAMBLADOR
Conjunto de Instrucciones
SET DE 35 INSTRUCCIONES
CONJUNTO DE INSTRUCCIONES PROGRAMACIÓN EN ASSEMBLER PARA PIC16F877A
This book guides the beginner to start up with Embedded C programming using MP LAB . This Book covers all interfacing examples with pic micro controller and guides beginners to develop projects on PIC micro controller
Slack (or Teams) Automation for Bonterra Impact Management (fka Social Soluti...Jeffrey Haguewood
Sidekick Solutions uses Bonterra Impact Management (fka Social Solutions Apricot) and automation solutions to integrate data for business workflows.
We believe integration and automation are essential to user experience and the promise of efficient work through technology. Automation is the critical ingredient to realizing that full vision. We develop integration products and services for Bonterra Case Management software to support the deployment of automations for a variety of use cases.
This video focuses on the notifications, alerts, and approval requests using Slack for Bonterra Impact Management. The solutions covered in this webinar can also be deployed for Microsoft Teams.
Interested in deploying notification automations for Bonterra Impact Management? Contact us at sales@sidekicksolutionsllc.com to discuss next steps.
Search and Society: Reimagining Information Access for Radical FuturesBhaskar Mitra
The field of Information retrieval (IR) is currently undergoing a transformative shift, at least partly due to the emerging applications of generative AI to information access. In this talk, we will deliberate on the sociotechnical implications of generative AI for information access. We will argue that there is both a critical necessity and an exciting opportunity for the IR community to re-center our research agendas on societal needs while dismantling the artificial separation between the work on fairness, accountability, transparency, and ethics in IR and the rest of IR research. Instead of adopting a reactionary strategy of trying to mitigate potential social harms from emerging technologies, the community should aim to proactively set the research agenda for the kinds of systems we should build inspired by diverse explicitly stated sociotechnical imaginaries. The sociotechnical imaginaries that underpin the design and development of information access technologies needs to be explicitly articulated, and we need to develop theories of change in context of these diverse perspectives. Our guiding future imaginaries must be informed by other academic fields, such as democratic theory and critical theory, and should be co-developed with social science scholars, legal scholars, civil rights and social justice activists, and artists, among others.
Essentials of Automations: Optimizing FME Workflows with ParametersSafe Software
Are you looking to streamline your workflows and boost your projects’ efficiency? Do you find yourself searching for ways to add flexibility and control over your FME workflows? If so, you’re in the right place.
Join us for an insightful dive into the world of FME parameters, a critical element in optimizing workflow efficiency. This webinar marks the beginning of our three-part “Essentials of Automation” series. This first webinar is designed to equip you with the knowledge and skills to utilize parameters effectively: enhancing the flexibility, maintainability, and user control of your FME projects.
Here’s what you’ll gain:
- Essentials of FME Parameters: Understand the pivotal role of parameters, including Reader/Writer, Transformer, User, and FME Flow categories. Discover how they are the key to unlocking automation and optimization within your workflows.
- Practical Applications in FME Form: Delve into key user parameter types including choice, connections, and file URLs. Allow users to control how a workflow runs, making your workflows more reusable. Learn to import values and deliver the best user experience for your workflows while enhancing accuracy.
- Optimization Strategies in FME Flow: Explore the creation and strategic deployment of parameters in FME Flow, including the use of deployment and geometry parameters, to maximize workflow efficiency.
- Pro Tips for Success: Gain insights on parameterizing connections and leveraging new features like Conditional Visibility for clarity and simplicity.
We’ll wrap up with a glimpse into future webinars, followed by a Q&A session to address your specific questions surrounding this topic.
Don’t miss this opportunity to elevate your FME expertise and drive your projects to new heights of efficiency.
UiPath Test Automation using UiPath Test Suite series, part 3DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 3. In this session, we will cover desktop automation along with UI automation.
Topics covered:
UI automation Introduction,
UI automation Sample
Desktop automation flow
Pradeep Chinnala, Senior Consultant Automation Developer @WonderBotz and UiPath MVP
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
GraphRAG is All You need? LLM & Knowledge GraphGuy Korland
Guy Korland, CEO and Co-founder of FalkorDB, will review two articles on the integration of language models with knowledge graphs.
1. Unifying Large Language Models and Knowledge Graphs: A Roadmap.
https://arxiv.org/abs/2306.08302
2. Microsoft Research's GraphRAG paper and a review paper on various uses of knowledge graphs:
https://www.microsoft.com/en-us/research/blog/graphrag-unlocking-llm-discovery-on-narrative-private-data/
The Art of the Pitch: WordPress Relationships and SalesLaura Byrne
Clients don’t know what they don’t know. What web solutions are right for them? How does WordPress come into the picture? How do you make sure you understand scope and timeline? What do you do if sometime changes?
All these questions and more will be explored as we talk about matching clients’ needs with what your agency offers without pulling teeth or pulling your hair out. Practical tips, and strategies for successful relationship building that leads to closing the deal.
Let's dive deeper into the world of ODC! Ricardo Alves (OutSystems) will join us to tell all about the new Data Fabric. After that, Sezen de Bruijn (OutSystems) will get into the details on how to best design a sturdy architecture within ODC.
Transcript: Selling digital books in 2024: Insights from industry leaders - T...BookNet Canada
The publishing industry has been selling digital audiobooks and ebooks for over a decade and has found its groove. What’s changed? What has stayed the same? Where do we go from here? Join a group of leading sales peers from across the industry for a conversation about the lessons learned since the popularization of digital books, best practices, digital book supply chain management, and more.
Link to video recording: https://bnctechforum.ca/sessions/selling-digital-books-in-2024-insights-from-industry-leaders/
Presented by BookNet Canada on May 28, 2024, with support from the Department of Canadian Heritage.
DevOps and Testing slides at DASA ConnectKari Kakkonen
My and Rik Marselis slides at 30.5.2024 DASA Connect conference. We discuss about what is testing, then what is agile testing and finally what is Testing in DevOps. Finally we had lovely workshop with the participants trying to find out different ways to think about quality and testing in different parts of the DevOps infinity loop.
UiPath Test Automation using UiPath Test Suite series, part 4DianaGray10
Welcome to UiPath Test Automation using UiPath Test Suite series part 4. In this session, we will cover Test Manager overview along with SAP heatmap.
The UiPath Test Manager overview with SAP heatmap webinar offers a concise yet comprehensive exploration of the role of a Test Manager within SAP environments, coupled with the utilization of heatmaps for effective testing strategies.
Participants will gain insights into the responsibilities, challenges, and best practices associated with test management in SAP projects. Additionally, the webinar delves into the significance of heatmaps as a visual aid for identifying testing priorities, areas of risk, and resource allocation within SAP landscapes. Through this session, attendees can expect to enhance their understanding of test management principles while learning practical approaches to optimize testing processes in SAP environments using heatmap visualization techniques
What will you get from this session?
1. Insights into SAP testing best practices
2. Heatmap utilization for testing
3. Optimization of testing processes
4. Demo
Topics covered:
Execution from the test manager
Orchestrator execution result
Defect reporting
SAP heatmap example with demo
Speaker:
Deepak Rai, Automation Practice Lead, Boundaryless Group and UiPath MVP
Smart TV Buyer Insights Survey 2024 by 91mobiles.pdf91mobiles
91mobiles recently conducted a Smart TV Buyer Insights Survey in which we asked over 3,000 respondents about the TV they own, aspects they look at on a new TV, and their TV buying preferences.
3. PIC16F87XA
28/40/44-Pin Enhanced Flash Microcontrollers
Devices Included in this Data Sheet: Analog Features:
• PIC16F873A • PIC16F876A • 10-bit, up to 8-channel Analog-to-Digital
• PIC16F874A • PIC16F877A Converter (A/D)
• Brown-out Reset (BOR)
High-Performance RISC CPU: • Analog Comparator module with:
- Two analog comparators
• Only 35 single-word instructions to learn
- Programmable on-chip voltage reference
• All single-cycle instructions except for program (VREF) module
branches, which are two-cycle
- Programmable input multiplexing from device
• Operating speed: DC – 20 MHz clock input inputs and internal voltage reference
DC – 200 ns instruction cycle
- Comparator outputs are externally accessible
• Up to 8K x 14 words of Flash Program Memory,
Up to 368 x 8 bytes of Data Memory (RAM),
Special Microcontroller Features:
Up to 256 x 8 bytes of EEPROM Data Memory
• Pinout compatible to other 28-pin or 40/44-pin • 100,000 erase/write cycle Enhanced Flash
PIC16CXXX and PIC16FXXX microcontrollers program memory typical
• 1,000,000 erase/write cycle Data EEPROM
Peripheral Features: memory typical
• Data EEPROM Retention > 40 years
• Timer0: 8-bit timer/counter with 8-bit prescaler
• Self-reprogrammable under software control
• Timer1: 16-bit timer/counter with prescaler,
can be incremented during Sleep via external • In-Circuit Serial Programming™ (ICSP™)
crystal/clock via two pins
• Timer2: 8-bit timer/counter with 8-bit period • Single-supply 5V In-Circuit Serial Programming
register, prescaler and postscaler • Watchdog Timer (WDT) with its own on-chip RC
• Two Capture, Compare, PWM modules oscillator for reliable operation
- Capture is 16-bit, max. resolution is 12.5 ns • Programmable code protection
- Compare is 16-bit, max. resolution is 200 ns • Power saving Sleep mode
- PWM max. resolution is 10-bit • Selectable oscillator options
• Synchronous Serial Port (SSP) with SPI™ • In-Circuit Debug (ICD) via two pins
(Master mode) and I2C™ (Master/Slave)
• Universal Synchronous Asynchronous Receiver CMOS Technology:
Transmitter (USART/SCI) with 9-bit address • Low-power, high-speed Flash/EEPROM
detection technology
• Parallel Slave Port (PSP) – 8 bits wide with • Fully static design
external RD, WR and CS controls (40/44-pin only)
• Wide operating voltage range (2.0V to 5.5V)
• Brown-out detection circuitry for
• Commercial and Industrial temperature ranges
Brown-out Reset (BOR)
• Low-power consumption
Program Memory Data MSSP
EEPROM 10-bit CCP Timers
Device # Single Word SRAM I/O USART Comparators
Bytes (Bytes) A/D (ch) (PWM) SPI Master 8/16-bit
Instructions (Bytes) 2
I C
PIC16F873A 7.2K 4096 192 128 22 5 2 Yes Yes Yes 2/1 2
PIC16F874A 7.2K 4096 192 128 33 8 2 Yes Yes Yes 2/1 2
PIC16F876A 14.3K 8192 368 256 22 5 2 Yes Yes Yes 2/1 2
PIC16F877A 14.3K 8192 368 256 33 8 2 Yes Yes Yes 2/1 2
2003 Microchip Technology Inc. DS39582B-page 1
6. PIC16F87XA
Table of Contents
1.0 Device Overview ......................................................................................................................................................................... 5
2.0 Memory Organization................................................................................................................................................................ 15
3.0 Data EEPROM and Flash Program Memory ............................................................................................................................ 33
4.0 I/O Ports.................................................................................................................................................................................... 41
5.0 Timer0 Module .......................................................................................................................................................................... 53
6.0 Timer1 Module .......................................................................................................................................................................... 57
7.0 Timer2 Module .......................................................................................................................................................................... 61
8.0 Capture/Compare/PWM Modules ............................................................................................................................................. 63
9.0 Master Synchronous Serial Port (MSSP) Module..................................................................................................................... 71
10.0 Addressable Universal Synchronous Asynchronous Receiver Transmitter (USART) ............................................................ 111
11.0 Analog-to-Digital Converter (A/D) Module .............................................................................................................................. 127
12.0 Comparator Module ................................................................................................................................................................ 135
13.0 Comparator Voltage Reference Module ................................................................................................................................. 141
14.0 Special Features of the CPU .................................................................................................................................................. 143
15.0 Instruction Set Summary......................................................................................................................................................... 159
16.0 Development Support ............................................................................................................................................................. 167
17.0 Electrical Characteristics......................................................................................................................................................... 173
18.0 DC and AC Characteristics Graphs and Tables ..................................................................................................................... 197
19.0 Packaging Information ............................................................................................................................................................ 209
Appendix A: Revision History ............................................................................................................................................................ 219
Appendix B: Device Differences........................................................................................................................................................ 219
Appendix C: Conversion Considerations........................................................................................................................................... 220
Index ................................................................................................................................................................................................. 221
On-Line Support................................................................................................................................................................................ 229
Systems Information and Upgrade Hot Line ..................................................................................................................................... 229
Reader Response ............................................................................................................................................................................. 230
PIC16F87XA Product Identification System...................................................................................................................................... 231
TO OUR VALUED CUSTOMERS
It is our intention to provide our valued customers with the best documentation possible to ensure successful use of your Microchip
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@mail.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)
• The Microchip Corporate Literature Center; U.S. FAX: (480) 792-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.
Customer Notification System
Register on our Web site at www.microchip.com/cn to receive the most current information on all of our products.
DS39582B-page 4 2003 Microchip Technology Inc.
7. PIC16F87XA
1.0 DEVICE OVERVIEW The available features are summarized in Table 1-1.
Block diagrams of the PIC16F873A/876A and
This document contains device specific information PIC16F874A/877A devices are provided in Figure 1-1
about the following devices: and Figure 1-2, respectively. The pinouts for these
• PIC16F873A device families are listed in Table 1-2 and Table 1-3.
• PIC16F874A Additional information may be found in the PICmicro®
• PIC16F876A Mid-Range Reference Manual (DS33023), which may
• PIC16F877A be obtained from your local Microchip Sales Represen-
tative or downloaded from the Microchip web site. The
PIC16F873A/876A devices are available only in 28-pin Reference Manual should be considered a complemen-
packages, while PIC16F874A/877A devices are avail- tary document to this data sheet and is highly recom-
able in 40-pin and 44-pin packages. All devices in the mended reading for a better understanding of the device
PIC16F87XA family share common architecture with architecture and operation of the peripheral modules.
the following differences:
• The PIC16F873A and PIC16F874A have one-half
of the total on-chip memory of the PIC16F876A
and PIC16F877A
• The 28-pin devices have three I/O ports, while the
40/44-pin devices have five
• The 28-pin devices have fourteen interrupts, while
the 40/44-pin devices have fifteen
• The 28-pin devices have five A/D input channels,
while the 40/44-pin devices have eight
• The Parallel Slave Port is implemented only on
the 40/44-pin devices
TABLE 1-1: PIC16F87XA DEVICE FEATURES
Key Features PIC16F873A PIC16F874A PIC16F876A PIC16F877A
Operating Frequency DC – 20 MHz DC – 20 MHz DC – 20 MHz DC – 20 MHz
Resets (and Delays) POR, BOR POR, BOR POR, BOR POR, BOR
(PWRT, OST) (PWRT, OST) (PWRT, OST) (PWRT, OST)
Flash Program Memory 4K 4K 8K 8K
(14-bit words)
Data Memory (bytes) 192 192 368 368
EEPROM Data Memory (bytes) 128 128 256 256
Interrupts 14 15 14 15
I/O Ports Ports A, B, C Ports A, B, C, D, E Ports A, B, C Ports A, B, C, D, E
Timers 3 3 3 3
Capture/Compare/PWM modules 2 2 2 2
Serial Communications MSSP, USART MSSP, USART MSSP, USART MSSP, USART
Parallel Communications — PSP — PSP
10-bit Analog-to-Digital Module 5 input channels 8 input channels 5 input channels 8 input channels
Analog Comparators 2 2 2 2
Instruction Set 35 Instructions 35 Instructions 35 Instructions 35 Instructions
Packages 28-pin PDIP 40-pin PDIP 28-pin PDIP 40-pin PDIP
28-pin SOIC 44-pin PLCC 28-pin SOIC 44-pin PLCC
28-pin SSOP 44-pin TQFP 28-pin SSOP 44-pin TQFP
28-pin QFN 44-pin QFN 28-pin QFN 44-pin QFN
2003 Microchip Technology Inc. DS39582B-page 5
8. PIC16F87XA
FIGURE 1-1: PIC16F873A/876A BLOCK DIAGRAM
13 Data Bus 8 PORTA
Program Counter
RA0/AN0
Flash RA1/AN1
Program RA2/AN2/VREF-/CVREF
Memory RAM RA3/AN3/VREF+
8 Level Stack File RA4/T0CKI/C1OUT
(13-bit) Registers RA5/AN4/SS/C2OUT
Program
14
Bus RAM Addr(1) 9
Addr MUX
Instruction reg
7 Indirect PORTB
Direct Addr
8 Addr RB0/INT
FSR reg RB1
RB2
RB3/PGM
Status reg
8 RB4
RB5
RB6/PGC
3 MUX RB7/PGD
Power-up
Timer
Instruction Oscillator
Decode & Start-up Timer
ALU
Control Power-on
Reset 8 PORTC
Timing Watchdog RC0/T1OSO/T1CKI
Generation Timer W reg
RC1/T1OSI/CCP2
OSC1/CLKI Brown-out RC2/CCP1
OSC2/CLKO Reset RC3/SCK/SCL
In-Circuit RC4/SDI/SDA
Debugger RC5/SDO
Low-Voltage RC6/TX/CK
Programming RC7/RX/DT
MCLR VDD, VSS
Timer0 Timer1 Timer2 10-bit A/D
Synchronous Voltage
Data EEPROM CCP1,2 USART Comparator Reference
Serial Port
Device Program Flash Data Memory Data EEPROM
PIC16F873A 4K words 192 Bytes 128 Bytes
PIC16F876A 8K words 368 Bytes 256 Bytes
Note 1: Higher order bits are from the Status register.
DS39582B-page 6 2003 Microchip Technology Inc.
9. PIC16F87XA
FIGURE 1-2: PIC16F874A/877A BLOCK DIAGRAM
13 Data Bus 8 PORTA
Program Counter
RA0/AN0
Flash RA1/AN1
Program RA2/AN2/VREF-/CVREF
Memory RAM RA3/AN3/VREF+
8 Level Stack
(13-bit) File RA4/T0CKI/C1OUT
Registers RA5/AN4/SS/C2OUT
Program 14
RAM Addr(1) PORTB
Bus 9
RB0/INT
Addr MUX RB1
Instruction reg
RB2
Direct Addr 7 Indirect
8 Addr RB3/PGM
RB4
FSR reg RB5
RB6/PGC
Status reg RB7/PGD
8
PORTC
RC0/T1OSO/T1CKI
3 MUX RC1/T1OSI/CCP2
Power-up
Timer RC2/CCP1
RC3/SCK/SCL
Instruction Oscillator
Start-up Timer RC4/SDI/SDA
Decode & ALU
Control RC5/SDO
Power-on RC6/TX/CK
Reset 8
RC7/RX/DT
Timing Watchdog
Generation W reg
Timer PORTD
OSC1/CLKI Brown-out RD0/PSP0
OSC2/CLKO Reset RD1/PSP1
In-Circuit RD2/PSP2
Debugger RD3/PSP3
Low-Voltage RD4/PSP4
Programming RD5/PSP5
RD6/PSP6
RD7/PSP7
PORTE
MCLR VDD, VSS RE0/RD/AN5
RE1/WR/AN6
RE2/CS/AN7
Timer2 Parallel
Timer0 Timer1 10-bit A/D Slave Port
Synchronous Voltage
Data EEPROM CCP1,2 USART Comparator Reference
Serial Port
Device Program Flash Data Memory Data EEPROM
PIC16F874A 4K words 192 Bytes 128 Bytes
PIC16F877A 8K words 368 Bytes 256 Bytes
Note 1: Higher order bits are from the Status register.
2003 Microchip Technology Inc. DS39582B-page 7
10. PIC16F87XA
TABLE 1-2: PIC16F873A/876A PINOUT DESCRIPTION
PDIP, SOIC, QFN I/O/P Buffer
Pin Name Description
SSOP Pin# Pin# Type Type
OSC1/CLKI 9 6 ST/CMOS(3) Oscillator crystal or external clock input.
OSC1 I Oscillator crystal input or external clock source input. ST
buffer when configured in RC mode; otherwise CMOS.
CLKI I External clock source input. Always associated with pin
function OSC1 (see OSC1/CLKI, OSC2/CLKO pins).
OSC2/CLKO 10 7 — Oscillator crystal or clock output.
OSC2 O Oscillator crystal output. Connects to crystal or resonator
in Crystal Oscillator mode.
CLKO O In RC mode, OSC2 pin outputs CLKO, which has 1/4 the
frequency of OSC1 and denotes the instruction cycle rate.
MCLR/VPP 1 26 ST Master Clear (input) or programming voltage (output).
MCLR I Master Clear (Reset) input. This pin is an active low Reset
to the device.
VPP P Programming voltage input.
PORTA is a bidirectional I/O port.
RA0/AN0 2 27 TTL
RA0 I/O Digital I/O.
AN0 I Analog input 0.
RA1/AN1 3 28 TTL
RA1 I/O Digital I/O.
AN1 I Analog input 1.
RA2/AN2/VREF-/ 4 1 TTL
CVREF I/O Digital I/O.
RA2 I Analog input 2.
AN2 I A/D reference voltage (Low) input.
VREF- O Comparator VREF output.
CVREF
RA3/AN3/VREF+ 5 2 TTL
RA3 I/O Digital I/O.
AN3 I Analog input 3.
VREF+ I A/D reference voltage (High) input.
RA4/T0CKI/C1OUT 6 3 ST
RA4 I/O Digital I/O – Open-drain when configured as output.
T0CKI I Timer0 external clock input.
C1OUT O Comparator 1 output.
RA5/AN4/SS/C2OUT 7 4 TTL
RA5 I/O Digital I/O.
AN4 I Analog input 4.
SS I SPI slave select input.
C2OUT O Comparator 2 output.
Legend: I = input O = output I/O = input/output P = power
— = Not used TTL = TTL input ST = Schmitt Trigger input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
DS39582B-page 8 2003 Microchip Technology Inc.
11. PIC16F87XA
TABLE 1-2: PIC16F873A/876A PINOUT DESCRIPTION (CONTINUED)
PDIP, SOIC, QFN I/O/P Buffer
Pin Name Description
SSOP Pin# Pin# Type Type
PORTB is a bidirectional I/O port. PORTB can be software
programmed for internal weak pull-ups on all inputs.
RB0/INT 21 18 TTL/ST(1)
RB0 I/O Digital I/O.
INT I External interrupt.
RB1 22 19 I/O TTL Digital I/O.
RB2 23 20 I/O TTL Digital I/O.
RB3/PGM 24 21 TTL
RB3 I/O Digital I/O.
PGM I Low-voltage (single-supply) ICSP programming enable pin.
RB4 25 22 I/O TTL Digital I/O.
RB5 26 23 I/O TTL Digital I/O.
RB6/PGC 27 24 TTL/ST(2)
RB6 I/O Digital I/O.
PGC I In-circuit debugger and ICSP programming clock.
RB7/PGD 28 25 TTL/ST(2)
RB7 I/O Digital I/O.
PGD I/O In-circuit debugger and ICSP programming data.
PORTC is a bidirectional I/O port.
RC0/T1OSO/T1CKI 11 8 ST
RC0 I/O Digital I/O.
T1OSO O Timer1 oscillator output.
T1CKI I Timer1 external clock input.
RC1/T1OSI/CCP2 12 9 ST
RC1 I/O Digital I/O.
T1OSI I Timer1 oscillator input.
CCP2 I/O Capture2 input, Compare2 output, PWM2 output.
RC2/CCP1 13 10 ST
RC2 I/O Digital I/O.
CCP1 I/O Capture1 input, Compare1 output, PWM1 output.
RC3/SCK/SCL 14 11 ST
RC3 I/O Digital I/O.
SCK I/O Synchronous serial clock input/output for SPI mode.
SCL I/O Synchronous serial clock input/output for I2C mode.
RC4/SDI/SDA 15 12 ST
RC4 I/O Digital I/O.
SDI I SPI data in.
SDA I/O I2C data I/O.
RC5/SDO 16 13 ST
RC5 I/O Digital I/O.
SDO O SPI data out.
RC6/TX/CK 17 14 ST
RC6 I/O Digital I/O.
TX O USART asynchronous transmit.
CK I/O USART1 synchronous clock.
RC7/RX/DT 18 15 ST
RC7 I/O Digital I/O.
RX I USART asynchronous receive.
DT I/O USART synchronous data.
VSS 8, 19 5, 6 P — Ground reference for logic and I/O pins.
VDD 20 17 P — Positive supply for logic and I/O pins.
Legend: I = input O = output I/O = input/output P = power
— = Not used TTL = TTL input ST = Schmitt Trigger input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
2003 Microchip Technology Inc. DS39582B-page 9
12. PIC16F87XA
TABLE 1-3: PIC16F874A/877A PINOUT DESCRIPTION
PDIP PLCC TQFP QFN I/O/P Buffer
Pin Name Description
Pin# Pin# Pin# Pin# Type Type
OSC1/CLKI 13 14 30 32 ST/CMOS(4) Oscillator crystal or external clock input.
OSC1 I Oscillator crystal input or external clock source
input. ST buffer when configured in RC mode;
otherwise CMOS.
CLKI I External clock source input. Always associated
with pin function OSC1 (see OSC1/CLKI,
OSC2/CLKO pins).
OSC2/CLKO 14 15 31 33 — Oscillator crystal or clock output.
OSC2 O Oscillator crystal output.
Connects to crystal or resonator in Crystal
Oscillator mode.
CLKO O In RC mode, OSC2 pin outputs CLKO, which
has 1/4 the frequency of OSC1 and denotes the
instruction cycle rate.
MCLR/VPP 1 2 18 18 ST Master Clear (input) or programming voltage (output).
MCLR I Master Clear (Reset) input. This pin is an active
low Reset to the device.
VPP P Programming voltage input.
PORTA is a bidirectional I/O port.
RA0/AN0 2 3 19 19 TTL
RA0 I/O Digital I/O.
AN0 I Analog input 0.
RA1/AN1 3 4 20 20 TTL
RA1 I/O Digital I/O.
AN1 I Analog input 1.
RA2/AN2/VREF-/CVREF 4 5 21 21 TTL
RA2 I/O Digital I/O.
AN2 I Analog input 2.
VREF- I A/D reference voltage (Low) input.
CVREF O Comparator VREF output.
RA3/AN3/VREF+ 5 6 22 22 TTL
RA3 I/O Digital I/O.
AN3 I Analog input 3.
VREF+ I A/D reference voltage (High) input.
RA4/T0CKI/C1OUT 6 7 23 23 ST
RA4 I/O Digital I/O – Open-drain when configured as
output.
T0CKI I Timer0 external clock input.
C1OUT O Comparator 1 output.
RA5/AN4/SS/C2OUT 7 8 24 24 TTL
RA5 I/O Digital I/O.
AN4 I Analog input 4.
SS I SPI slave select input.
C2OUT O Comparator 2 output.
Legend: I = input O = output I/O = input/output P = power
— = Not used TTL = TTL input ST = Schmitt Trigger input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
DS39582B-page 10 2003 Microchip Technology Inc.
13. PIC16F87XA
TABLE 1-3: PIC16F874A/877A PINOUT DESCRIPTION (CONTINUED)
PDIP PLCC TQFP QFN I/O/P Buffer
Pin Name Description
Pin# Pin# Pin# Pin# Type Type
PORTB is a bidirectional I/O port. PORTB can be
software programmed for internal weak pull-up on all
inputs.
RB0/INT 33 36 8 9 TTL/ST(1)
RB0 I/O Digital I/O.
INT I External interrupt.
RB1 34 37 9 10 I/O TTL Digital I/O.
RB2 35 38 10 11 I/O TTL Digital I/O.
RB3/PGM 36 39 11 12 TTL
RB3 I/O Digital I/O.
PGM I Low-voltage ICSP programming enable pin.
RB4 37 41 14 14 I/O TTL Digital I/O.
RB5 38 42 15 15 I/O TTL Digital I/O.
RB6/PGC 39 43 16 16 TTL/ST(2)
RB6 I/O Digital I/O.
PGC I In-circuit debugger and ICSP programming clock.
RB7/PGD 40 44 17 17 TTL/ST(2)
RB7 I/O Digital I/O.
PGD I/O In-circuit debugger and ICSP programming data.
Legend: I = input O = output I/O = input/output P = power
— = Not used TTL = TTL input ST = Schmitt Trigger input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
2003 Microchip Technology Inc. DS39582B-page 11
14. PIC16F87XA
TABLE 1-3: PIC16F874A/877A PINOUT DESCRIPTION (CONTINUED)
PDIP PLCC TQFP QFN I/O/P Buffer
Pin Name Description
Pin# Pin# Pin# Pin# Type Type
PORTC is a bidirectional I/O port.
RC0/T1OSO/T1CKI 15 16 32 34 ST
RC0 I/O Digital I/O.
T1OSO O Timer1 oscillator output.
T1CKI I Timer1 external clock input.
RC1/T1OSI/CCP2 16 18 35 35 ST
RC1 I/O Digital I/O.
T1OSI I Timer1 oscillator input.
CCP2 I/O Capture2 input, Compare2 output, PWM2 output.
RC2/CCP1 17 19 36 36 ST
RC2 I/O Digital I/O.
CCP1 I/O Capture1 input, Compare1 output, PWM1 output.
RC3/SCK/SCL 18 20 37 37 ST
RC3 I/O Digital I/O.
SCK I/O Synchronous serial clock input/output for SPI
mode.
SCL I/O Synchronous serial clock input/output for I2C
mode.
RC4/SDI/SDA 23 25 42 42 ST
RC4 I/O Digital I/O.
SDI I SPI data in.
SDA I/O I2C data I/O.
RC5/SDO 24 26 43 43 ST
RC5 I/O Digital I/O.
SDO O SPI data out.
RC6/TX/CK 25 27 44 44 ST
RC6 I/O Digital I/O.
TX O USART asynchronous transmit.
CK I/O USART1 synchronous clock.
RC7/RX/DT 26 29 1 1 ST
RC7 I/O Digital I/O.
RX I USART asynchronous receive.
DT I/O USART synchronous data.
Legend: I = input O = output I/O = input/output P = power
— = Not used TTL = TTL input ST = Schmitt Trigger input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
DS39582B-page 12 2003 Microchip Technology Inc.
15. PIC16F87XA
TABLE 1-3: PIC16F874A/877A PINOUT DESCRIPTION (CONTINUED)
PDIP PLCC TQFP QFN I/O/P Buffer
Pin Name Description
Pin# Pin# Pin# Pin# Type Type
PORTD is a bidirectional I/O port or Parallel Slave
Port when interfacing to a microprocessor bus.
RD0/PSP0 19 21 38 38 ST/TTL(3)
RD0 I/O Digital I/O.
PSP0 I/O Parallel Slave Port data.
RD1/PSP1 20 22 39 39 ST/TTL(3)
RD1 I/O Digital I/O.
PSP1 I/O Parallel Slave Port data.
RD2/PSP2 21 23 40 40 ST/TTL(3)
RD2 I/O Digital I/O.
PSP2 I/O Parallel Slave Port data.
RD3/PSP3 22 24 41 41 ST/TTL(3)
RD3 I/O Digital I/O.
PSP3 I/O Parallel Slave Port data.
RD4/PSP4 27 30 2 2 ST/TTL(3)
RD4 I/O Digital I/O.
PSP4 I/O Parallel Slave Port data.
RD5/PSP5 28 31 3 3 ST/TTL(3)
RD5 I/O Digital I/O.
PSP5 I/O Parallel Slave Port data.
RD6/PSP6 29 32 4 4 ST/TTL(3)
RD6 I/O Digital I/O.
PSP6 I/O Parallel Slave Port data.
RD7/PSP7 30 33 5 5 ST/TTL(3)
RD7 I/O Digital I/O.
PSP7 I/O Parallel Slave Port data.
PORTE is a bidirectional I/O port.
RE0/RD/AN5 8 9 25 25 ST/TTL(3)
RE0 I/O Digital I/O.
RD I Read control for Parallel Slave Port.
AN5 I Analog input 5.
RE1/WR/AN6 9 10 26 26 ST/TTL(3)
RE1 I/O Digital I/O.
WR I Write control for Parallel Slave Port.
AN6 I Analog input 6.
RE2/CS/AN7 10 11 27 27 ST/TTL(3)
RE2 I/O Digital I/O.
CS I Chip select control for Parallel Slave Port.
AN7 I Analog input 7.
VSS 12, 31 13, 34 6, 29 6, 30, P — Ground reference for logic and I/O pins.
31
VDD 11, 32 12, 35 7, 28 7, 8, P — Positive supply for logic and I/O pins.
28, 29
NC — 1, 17, 12,13, 13 — — These pins are not internally connected. These pins
28, 40 33, 34 should be left unconnected.
Legend: I = input O = output I/O = input/output P = power
— = Not used TTL = TTL input ST = Schmitt Trigger input
Note 1: This buffer is a Schmitt Trigger input when configured as the external interrupt.
2: This buffer is a Schmitt Trigger input when used in Serial Programming mode.
3: This buffer is a Schmitt Trigger input when configured in RC Oscillator mode and a CMOS input otherwise.
2003 Microchip Technology Inc. DS39582B-page 13
17. PIC16F87XA
2.0 MEMORY ORGANIZATION 2.1 Program Memory Organization
There are three memory blocks in each of the The PIC16F87XA devices have a 13-bit program
PIC16F87XA devices. The program memory and data counter capable of addressing an 8K word x 14 bit
memory have separate buses so that concurrent program memory space. The PIC16F876A/877A
access can occur and is detailed in this section. The devices have 8K words x 14 bits of Flash program
EEPROM data memory block is detailed in Section 3.0 memory, while PIC16F873A/874A devices have
“Data EEPROM and Flash Program Memory”. 4K words x 14 bits. Accessing a location above the
physically implemented address will cause a
Additional information on device memory may be found
wraparound.
in the PICmicro® Mid-Range MCU Family Reference
Manual (DS33023). The Reset vector is at 0000h and the interrupt vector is
at 0004h.
FIGURE 2-1: PIC16F876A/877A FIGURE 2-2: PIC16F873A/874A
PROGRAM MEMORY MAP PROGRAM MEMORY MAP
AND STACK AND STACK
PC<12:0> PC<12:0>
13 CALL, RETURN 13
CALL, RETURN
RETFIE, RETLW RETFIE, RETLW
Stack Level 1
Stack Level 1
Stack Level 2
Stack Level 2
Stack Level 8 Stack Level 8
Reset Vector 0000h
Reset Vector 0000h
Interrupt Vector 0004h
Interrupt Vector 0004h
0005h 0005h
Page 0
Page 0 On-Chip
07FFh
07FFh Program
Memory 0800h
0800h
Page 1 Page 1
On-Chip 0FFFh
0FFFh
Program
1000h
Memory 1000h
Page 2
17FFh
1800h
Page 3
1FFFh
1FFFh
2003 Microchip Technology Inc. DS39582B-page 15
18. PIC16F87XA
2.2 Data Memory Organization Each bank extends up to 7Fh (128 bytes). The lower
locations of each bank are reserved for the Special
The data memory is partitioned into multiple banks Function Registers. Above the Special Function Regis-
which contain the General Purpose Registers and the ters are General Purpose Registers, implemented as
Special Function Registers. Bits RP1 (Status<6>) and static RAM. All implemented banks contain Special
RP0 (Status<5>) are the bank select bits. Function Registers. Some frequently used Special
Function Registers from one bank may be mirrored in
another bank for code reduction and quicker access.
RP1:RP0 Bank
00 0 Note: The EEPROM data memory description can
be found in Section 3.0 “Data EEPROM
01 1 and Flash Program Memory” of this data
10 2 sheet.
11 3
2.2.1 GENERAL PURPOSE REGISTER
FILE
The register file can be accessed either directly, or
indirectly, through the File Select Register (FSR).
DS39582B-page 16 2003 Microchip Technology Inc.