PIC16F887 8-bit Microcontroller: Programming, Datasheet and Pinout
14KB 8K x 14 FLASH PIC 8-Bit Microcontroller PIC® 16F Series PIC16F887 40 Pin 20MHz 5V 40-DIP (0.600, 15.24mm)









14KB 8K x 14 FLASH PIC 8-Bit Microcontroller PIC® 16F Series PIC16F887 40 Pin 20MHz 5V 40-DIP (0.600, 15.24mm)
The PIC16F887 is an 8-bit microcontroller from Microchip. This post covers pinout, programming, datasheet, specifications, tutorial, and other details about the PIC16F887 microcontroller. Furthermore, there is a huge range of semiconductors, capacitors, resistors, and ICs in stock. Welcome your RFQ!

Microcontroller PIC16F887 Video 01 Introduction to Microcontroller
PIC16F887 Pinout


PIC16F887 Pinout
| Pin Number | Pin Name | Description |
| 1 | MCLR/Vpp/RE3 | MCLR is used during programming, mostly connected to programmers like PicKit or 3rd pin of PORTE |
| 2 | RA0/AN0 | Analog pin 0 or 0th pin of PORTA |
| 3 | RA1/AN1 | Analog pin 1 or 1st pin of PORTA |
| 4 | RA2/AN2/Vref- | Analog pin 2 or 2nd pin of PORTA |
| 5 | RA3/AN3/Vref+ | Analog pin 3 or 3rd pin of PORTA |
| 6 | RA4/T0CKI/C1out | 4th pin of PORTA |
| 7 | RA5/AN4/SS/C2out | Analog pin 4 or 5th pin of PORTA |
| 8 | RE0/RD/AN5 | Analog pin 5 or 0th pin of PORTE |
| 9 | RE1/WR/AN6 | Analog pin 6 or 1st pin of PORTE |
| 10 | RE2/CS/AN7 | Analog pin 6 or 2nd pin of PORTE |
| 11 | Vdd | Ground pin of MCU |
| 12 | Vss | Positive pin of MCU (+5V) |
| 13 | RA7/OSC1/CLKI | External Oscillator/clock input pin or 7th pin of PORTA |
| 14 | RA6/OSC2/CLKO | External Oscillator/clock output pin or 6th pin of PORTA |
| 15 | RC0/T1OSO/T1CKI | 0th pin of PORT C |
| 16 | RC1/T1OSI/CCP2 | 1st pin of POCTC or Timer/PWM pin |
| 17 | RC2/CCP1 | 2nd pin of POCTC or Timer/PWM pin |
| 18 | RC3/SCK/SCL | 3rd pin of POCTC |
| 19 | RD0 | 0th pin of POCTD |
| 20 | RD1 | 1st pin of POCTD |
| 21 | RD2 | 2nd pin of POCTD |
| 22 | RD3 | 3rd pin of POCTD |
| 23 | RC4/SDI/SDA | 4th pin of POCTC or Serial Data in pin |
| 24 | RC5/SDO | 5th pin of POCTC or Serial Data Out pin |
| 25 | RC6/Tx/CK | 6th pin of POCTC or Transmitter pin of Microcontroller |
| 26 | RC7/Rx/DT | 7th pin of POCTC or Receiver pin of Microcontroller |
| 27 | RD4 | 4th pin of POCTD |
| 28 | RD5/P1B | 5th pin of POCTD |
| 29 | RD6/P1C | 6th pin of POCTD |
| 30 | RD7/P1D | 7th pin of POCTD |
| 31 | Vss | Positive pin of MCU (+5V) |
| 32 | Vdd | Ground pin of MCU |
| 33 | RB0/INT | 0th pin of POCTB or External Interrupt pin |
| 34 | RB1/AN10 | Analog pin 10 or 1st pin of POCTB |
| 35 | RB2 /AN8 | Analog pin 8 or 2nd pin of POCTB |
| 36 | RB3/PGM/AN9 | Analog pin 9 or 3rd pin of POCTB or connected to the programmer |
| 37 | RB4/AN11 | Analog pin 11 or 4th pin of POCTB |
| 38 | RB5/AN13 | Analog pin 13 or 5th pin of POCTB |
| 39 | RB6/PGC | 6th pin of POCTB or connected to the programmer |
| 40 | RB7/PGD | 7th pin of POCTB or connected to the programmer |
What is PIC16F887?
The PIC16F887 is an 8-bit microcontroller featuring RSIC CPU technology, which allows it to produce maximum output while consuming little power. It has a total of 40 pins, all of which are packaged in numerous ways to meet the needs of tiny and modern circuits. QFN and TQFP packages with 44 pins are also available. PIC16F887 gives developers access to all modern protocols, and because of its numerous pins, most protocols can be tracked at the same time without interfering with others.
PIC16F887 CAD Model

PIC16F887 Symbol

PIC16F887 Footprint

PIC16F887 3D Model
Specifications
- TypeParameter
- Factory Lead Time6 Weeks
- Mount
In electronic components, the term "Mount" typically refers to the method or process of physically attaching or fixing a component onto a circuit board or other electronic device. This can involve soldering, adhesive bonding, or other techniques to secure the component in place. The mounting process is crucial for ensuring proper electrical connections and mechanical stability within the electronic system. Different components may have specific mounting requirements based on their size, shape, and function, and manufacturers provide guidelines for proper mounting procedures to ensure optimal performance and reliability of the electronic device.
Through Hole - Mounting Type
The "Mounting Type" in electronic components refers to the method used to attach or connect a component to a circuit board or other substrate, such as through-hole, surface-mount, or panel mount.
Through Hole - Package / Case
refers to the protective housing that encases an electronic component, providing mechanical support, electrical connections, and thermal management.
40-DIP (0.600, 15.24mm) - Number of Pins40
- Data ConvertersA/D 14x10b
- Number of I/Os35
- Watchdog TimersYes
- Operating Temperature
The operating temperature is the range of ambient temperature within which a power supply, or any other electrical equipment, operate in. This ranges from a minimum operating temperature, to a peak or maximum operating temperature, outside which, the power supply may fail.
-40°C~125°C TA - Packaging
Semiconductor package is a carrier / shell used to contain and cover one or more semiconductor components or integrated circuits. The material of the shell can be metal, plastic, glass or ceramic.
Tube - Series
In electronic components, the "Series" refers to a group of products that share similar characteristics, designs, or functionalities, often produced by the same manufacturer. These components within a series typically have common specifications but may vary in terms of voltage, power, or packaging to meet different application needs. The series name helps identify and differentiate between various product lines within a manufacturer's catalog.
PIC® 16F - Published2007
- JESD-609 Code
The "JESD-609 Code" in electronic components refers to a standardized marking code that indicates the lead-free solder composition and finish of electronic components for compliance with environmental regulations.
e3 - Pbfree Code
The "Pbfree Code" parameter in electronic components refers to the code or marking used to indicate that the component is lead-free. Lead (Pb) is a toxic substance that has been widely used in electronic components for many years, but due to environmental concerns, there has been a shift towards lead-free alternatives. The Pbfree Code helps manufacturers and users easily identify components that do not contain lead, ensuring compliance with regulations and promoting environmentally friendly practices. It is important to pay attention to the Pbfree Code when selecting electronic components to ensure they meet the necessary requirements for lead-free applications.
yes - Part Status
Parts can have many statuses as they progress through the configuration, analysis, review, and approval stages.
Active - Moisture Sensitivity Level (MSL)
Moisture Sensitivity Level (MSL) is a standardized rating that indicates the susceptibility of electronic components, particularly semiconductors, to moisture-induced damage during storage and the soldering process, defining the allowable exposure time to ambient conditions before they require special handling or baking to prevent failures
1 (Unlimited) - Number of Terminations40
- ECCN Code
An ECCN (Export Control Classification Number) is an alphanumeric code used by the U.S. Bureau of Industry and Security to identify and categorize electronic components and other dual-use items that may require an export license based on their technical characteristics and potential for military use.
EAR99 - Terminal Finish
Terminal Finish refers to the surface treatment applied to the terminals or leads of electronic components to enhance their performance and longevity. It can improve solderability, corrosion resistance, and overall reliability of the connection in electronic assemblies. Common finishes include nickel, gold, and tin, each possessing distinct properties suitable for various applications. The choice of terminal finish can significantly impact the durability and effectiveness of electronic devices.
Matte Tin (Sn) - annealed - Max Power Dissipation
The maximum power that the MOSFET can dissipate continuously under the specified thermal conditions.
800mW - Terminal Position
In electronic components, the term "Terminal Position" refers to the physical location of the connection points on the component where external electrical connections can be made. These connection points, known as terminals, are typically used to attach wires, leads, or other components to the main body of the electronic component. The terminal position is important for ensuring proper connectivity and functionality of the component within a circuit. It is often specified in technical datasheets or component specifications to help designers and engineers understand how to properly integrate the component into their circuit designs.
DUAL - Supply Voltage
Supply voltage refers to the electrical potential difference provided to an electronic component or circuit. It is crucial for the proper operation of devices, as it powers their functions and determines performance characteristics. The supply voltage must be within specified limits to ensure reliability and prevent damage to components. Different electronic devices have specific supply voltage requirements, which can vary widely depending on their design and intended application.
5V - Frequency
In electronic components, the parameter "Frequency" refers to the rate at which a signal oscillates or cycles within a given period of time. It is typically measured in Hertz (Hz) and represents how many times a signal completes a full cycle in one second. Frequency is a crucial aspect in electronic components as it determines the behavior and performance of various devices such as oscillators, filters, and communication systems. Understanding the frequency characteristics of components is essential for designing and analyzing electronic circuits to ensure proper functionality and compatibility with other components in a system.
20MHz - Base Part Number
The "Base Part Number" (BPN) in electronic components serves a similar purpose to the "Base Product Number." It refers to the primary identifier for a component that captures the essential characteristics shared by a group of similar components. The BPN provides a fundamental way to reference a family or series of components without specifying all the variations and specific details.
PIC16F887 - Pin Count
a count of all of the component leads (or pins)
40 - Supply Voltage-Max (Vsup)
The parameter "Supply Voltage-Max (Vsup)" in electronic components refers to the maximum voltage that can be safely applied to the component without causing damage. It is an important specification to consider when designing or using electronic circuits to ensure the component operates within its safe operating limits. Exceeding the maximum supply voltage can lead to overheating, component failure, or even permanent damage. It is crucial to adhere to the specified maximum supply voltage to ensure the reliable and safe operation of the electronic component.
5.5V - Supply Voltage-Min (Vsup)
The parameter "Supply Voltage-Min (Vsup)" in electronic components refers to the minimum voltage level required for the component to operate within its specified performance range. This parameter indicates the lowest voltage that can be safely applied to the component without risking damage or malfunction. It is crucial to ensure that the supply voltage provided to the component meets or exceeds this minimum value to ensure proper functionality and reliability. Failure to adhere to the specified minimum supply voltage may result in erratic behavior, reduced performance, or even permanent damage to the component.
4.5V - Interface
In electronic components, the term "Interface" refers to the point at which two different systems, devices, or components connect and interact with each other. It can involve physical connections such as ports, connectors, or cables, as well as communication protocols and standards that facilitate the exchange of data or signals between the connected entities. The interface serves as a bridge that enables seamless communication and interoperability between different parts of a system or between different systems altogether. Designing a reliable and efficient interface is crucial in ensuring proper functionality and performance of electronic components and systems.
I2C, SPI, UART, USART - Memory Size
The memory capacity is the amount of data a device can store at any given time in its memory.
14kB - Oscillator Type
Wien Bridge Oscillator; RC Phase Shift Oscillator; Hartley Oscillator; Voltage Controlled Oscillator; Colpitts Oscillator; Clapp Oscillators; Crystal Oscillators; Armstrong Oscillator.
Internal - RAM Size
RAM size refers to the amount of random access memory (RAM) available in an electronic component, such as a computer or smartphone. RAM is a type of volatile memory that stores data and instructions that are actively being used by the device's processor. The RAM size is typically measured in gigabytes (GB) and determines how much data the device can store and access quickly for processing. A larger RAM size allows for smoother multitasking, faster loading times, and better overall performance of the electronic component. It is an important factor to consider when choosing a device, especially for tasks that require a lot of memory, such as gaming, video editing, or running multiple applications simultaneously.
368 x 8 - Voltage - Supply (Vcc/Vdd)
Voltage - Supply (Vcc/Vdd) is a key parameter in electronic components that specifies the voltage level required for the proper operation of the device. It represents the power supply voltage that needs to be provided to the component for it to function correctly. This parameter is crucial as supplying the component with the correct voltage ensures that it operates within its specified limits and performance characteristics. It is typically expressed in volts (V) and is an essential consideration when designing and using electronic circuits to prevent damage and ensure reliable operation.
2V~5.5V - uPs/uCs/Peripheral ICs Type
The parameter "uPs/uCs/Peripheral ICs Type" refers to the classification of various integrated circuits used in electronic devices. It encompasses microprocessors (uPs), microcontrollers (uCs), and peripheral integrated circuits that provide additional functionalities. This classification helps in identifying the specific type of chip used for processing tasks, controlling hardware, or interfacing with other components in a system. Understanding this parameter is essential for selecting the appropriate electronic components for a given application.
MICROCONTROLLER, RISC - Core Processor
The term "Core Processor" typically refers to the central processing unit (CPU) of a computer or electronic device. It is the primary component responsible for executing instructions, performing calculations, and managing data within the system. The core processor is often considered the brain of the device, as it controls the overall operation and functionality. It is crucial for determining the speed and performance capabilities of the device, as well as its ability to handle various tasks and applications efficiently. In modern devices, core processors can have multiple cores, allowing for parallel processing and improved multitasking capabilities.
PIC - Peripherals
In the context of electronic components, "Peripherals" refer to devices or components that are connected to a main system or device to enhance its functionality or provide additional features. These peripherals can include input devices such as keyboards, mice, and touchscreens, as well as output devices like monitors, printers, and speakers. Other examples of peripherals include external storage devices, network adapters, and cameras. Essentially, peripherals are external devices that expand the capabilities of a main electronic system or device.
Brown-out Detect/Reset, POR, PWM, WDT - Program Memory Type
Program memory typically refers to flash memory when it is used to hold the program (instructions). Program memory may also refer to a hard drive or solid state drive (SSD). Contrast with data memory.
FLASH - Core Size
Core size in electronic components refers to the physical dimensions of the core material used in devices such as inductors and transformers. The core size directly impacts the performance characteristics of the component, including its inductance, saturation current, and frequency response. A larger core size typically allows for higher power handling capabilities and lower core losses, while a smaller core size may result in a more compact design but with limitations on power handling and efficiency. Designers must carefully select the core size based on the specific requirements of the application to achieve optimal performance and efficiency.
8-Bit - Program Memory Size
Program Memory Size refers to the amount of memory available in an electronic component, such as a microcontroller or microprocessor, that is used to store program instructions. This memory is non-volatile, meaning that the data stored in it is retained even when the power is turned off. The program memory size determines the maximum amount of code that can be stored and executed by the electronic component. It is an important parameter to consider when selecting a component for a specific application, as insufficient program memory size may limit the functionality or performance of the device.
14KB 8K x 14 - Connectivity
In electronic components, "Connectivity" refers to the ability of a component to establish and maintain connections with other components or devices within a circuit. It is a crucial parameter that determines how easily signals can be transmitted between different parts of a circuit. Connectivity can be influenced by factors such as the number of input and output ports, the type of connectors used, and the overall design of the component. Components with good connectivity are essential for ensuring reliable and efficient operation of electronic systems.
I2C, SPI, UART/USART - Supply Current-Max
Supply Current-Max refers to the maximum amount of current that an electronic component or circuit can draw from its power supply under specified operating conditions. It is a critical parameter that determines the power consumption and thermal performance of the device. Exceeding this limit can lead to overheating, potential damage, or failure of the component. Knowing the Supply Current-Max helps in designing circuits that ensure proper operation and reliability.
4.8mA - Bit Size
In electronic components, "Bit Size" refers to the number of bits that can be processed or stored by a particular component. A bit is the smallest unit of data in computing and can have a value of either 0 or 1. The Bit Size parameter is commonly used to describe the capacity or performance of components such as microprocessors, memory modules, and data buses. A larger Bit Size generally indicates a higher processing capability or storage capacity, allowing for more complex operations and larger amounts of data to be handled efficiently. It is an important specification to consider when selecting electronic components for specific applications that require certain levels of performance and data processing capabilities.
8 - Access Time
Access time in electronic components refers to the amount of time it takes for a system to retrieve data from memory or storage once a request has been made. It is typically measured in nanoseconds or microseconds and indicates the speed at which data can be accessed. Lower access time values signify faster performance, allowing for more efficient processing in computing systems. Access time is a critical parameter in determining the overall responsiveness of electronic devices, particularly in applications requiring quick data retrieval.
20 μs - Has ADC
Has ADC refers to the presence of an Analog-to-Digital Converter (ADC) in an electronic component. An ADC is a crucial component in many electronic devices as it converts analog signals, such as voltage or current, into digital data that can be processed by a digital system. Having an ADC allows the electronic component to interface with analog signals and convert them into a format that can be manipulated and analyzed digitally. This parameter is important for applications where analog signals need to be converted into digital form for further processing or control.
YES - DMA Channels
DMA (Direct Memory Access) Channels are a feature found in electronic components such as microcontrollers, microprocessors, and peripheral devices. DMA Channels allow data to be transferred directly between peripherals and memory without involving the CPU, thereby reducing the burden on the CPU and improving overall system performance. Each DMA Channel is typically assigned to a specific peripheral device or memory region, enabling efficient data transfer operations. The number of DMA Channels available in a system determines the concurrent data transfer capabilities and can vary depending on the specific hardware design. Overall, DMA Channels play a crucial role in optimizing data transfer efficiency and system performance in electronic devices.
NO - Data Bus Width
The data bus width in electronic components refers to the number of bits that can be transferred simultaneously between the processor and memory. It determines the amount of data that can be processed and transferred in a single operation. A wider data bus allows for faster data transfer speeds and improved overall performance of the electronic device. Common data bus widths include 8-bit, 16-bit, 32-bit, and 64-bit, with higher numbers indicating a larger capacity for data transfer. The data bus width is an important specification to consider when evaluating the speed and efficiency of a computer system or other electronic device.
8b - PWM Channels
PWM Channels, or Pulse Width Modulation Channels, refer to the number of independent PWM outputs available in an electronic component, such as a microcontroller or a motor driver. PWM is a technique used to generate analog-like signals by varying the duty cycle of a square wave signal. Each PWM channel can control the output of a specific device or component by adjusting the pulse width of the signal. Having multiple PWM channels allows for precise control of multiple devices simultaneously, making it a valuable feature in applications such as motor control, LED dimming, and audio signal generation. The number of PWM channels available in a component determines the flexibility and complexity of the system it can control.
YES - Number of Timers/Counters3
- EEPROM Size
EEPROM Size refers to the amount of memory capacity available in an Electrically Erasable Programmable Read-Only Memory (EEPROM) chip. This parameter indicates the total storage space in bytes or bits that can be used to store data in a non-volatile manner. The EEPROM size determines the maximum amount of information that can be written, read, and erased from the memory chip. It is an important specification to consider when selecting an EEPROM for a particular application, as it directly impacts the amount of data that can be stored and accessed by the electronic component.
256 x 8 - CPU Family
CPU Family refers to a classification of microprocessors that share a common architecture and design traits. It signifies a group of processors that are typically produced by the same manufacturer and have similar functionality and features. The CPU Family can encompass various models that may differ in performance, power consumption, and specific capabilities but retain a unified core design, allowing for compatibility with software and hardware. This classification helps users and developers to understand the performance characteristics and upgrade pathways of different CPU models within the same family.
PIC - Number of ADC Channels14
- Number of I2C Channels1
- Number of SPI Channels2
- Height4.953mm
- Length53.21mm
- Width14.732mm
- REACH SVHC
The parameter "REACH SVHC" in electronic components refers to the compliance with the Registration, Evaluation, Authorization, and Restriction of Chemicals (REACH) regulation regarding Substances of Very High Concern (SVHC). SVHCs are substances that may have serious effects on human health or the environment, and their use is regulated under REACH to ensure their safe handling and minimize their impact.Manufacturers of electronic components need to declare if their products contain any SVHCs above a certain threshold concentration and provide information on the safe use of these substances. This information allows customers to make informed decisions about the potential risks associated with using the components and take appropriate measures to mitigate any hazards.Ensuring compliance with REACH SVHC requirements is essential for electronics manufacturers to meet regulatory standards, protect human health and the environment, and maintain transparency in their supply chain. It also demonstrates a commitment to sustainability and responsible manufacturing practices in the electronics industry.
No SVHC - Radiation Hardening
Radiation hardening is the process of making electronic components and circuits resistant to damage or malfunction caused by high levels of ionizing radiation, especially for environments in outer space (especially beyond the low Earth orbit), around nuclear reactors and particle accelerators, or during nuclear accidents or nuclear warfare.
No - RoHS Status
RoHS means “Restriction of Certain Hazardous Substances” in the “Hazardous Substances Directive” in electrical and electronic equipment.
ROHS3 Compliant - Lead Free
Lead Free is a term used to describe electronic components that do not contain lead as part of their composition. Lead is a toxic material that can have harmful effects on human health and the environment, so the electronics industry has been moving towards lead-free components to reduce these risks. Lead-free components are typically made using alternative materials such as silver, copper, and tin. Manufacturers must comply with regulations such as the Restriction of Hazardous Substances (RoHS) directive to ensure that their products are lead-free and environmentally friendly.
Lead Free
PIC16F887 Features
| CPU Architecture | 8-bit PIC |
| Internal Oscillator | 8MHz |
| External Oscillator | 20MHz |
| Operating Voltage Range | (2V – 5.5V) |
| GPIO PORTS | 36 I/O Pins |
| Interrupts | 1 |
| Timers | 3 – (Two 8-bit and one 16-bit timer) |
| Comparators | 2 |
| PWM | 2 CCP and 2-PWM |
| ICP | One ICP Pin |
| USART | 1-Channel |
| I2C | 1-Channel |
| SPI/MSSP | 1-Channel |
| ICSP/MSSP | Available |
| ULPWU | Available |
| Watchdog timer | Available |
| Self-Programming | Available |
| LAN | Not Available |
| CAN | Not Available |
| ADC | 14-Channel |
| SRAM | 368 b |
| FLASH (Program Memory) | 14Kb |
| EEPROM | 256 bytes |
Alternatives for PIC16F887
PIC16F877A, PIC16F886, PIC16F84A, PIC18F2550, PIC18F46K22, PIC16F676, PIC16F72, PIC16F873A, PIC16F876A, PIC16F886, PIC18F252, PIC18F2520, PIC18F452, PIC18F4520
PIC16F887 Applications
Design that necessitates a large number of ADC channels
Low-power battery-operated applications with many I/O interfaces and communications
Ideal for higher-level A/D applications in the automotive, industrial, appliance, and consumer markets
GPIO Pins PIC16F877A Microcontroller
To start learning pic microcontroller programming, you should have a grasp of GPIO pins.
Digital Output:
The microcontroller has many output pins. All of the pins come from five different registers (A, B, C, and D & E). They can be used with any TTL/CMOS or ST device. According to the power source, all GPIO pins provide the maximum output voltage. The following is a list of all output pins:
PA0 – GPIO2
PA1 – GPIO3
PA2 – GPIO4
PA3 – GPIO5
PA4 – GPIO6
PA5 – GPIO7
PA6 – GPIO14
PA7 – GPIO12
PB0 – GPIO33
PB1 – GPIO34
PB2 – GPIO35
PB3 – GPIO36
PB4 – GPIO37
PB5 – GPIO38
PB6 – GPIO39
PB7 – GPIO40
PC0 – GPIO15
PC1 – GPIO16
PC2 – GPIO17
PC3 – GPIO18
PC4 – GPIO23
PC5 – GPIO24
PC6 – GPIO25
PC7 – GPIO26
PD0 – GPIO19
PD1 – GPIO20
PD2 – GPIO21
PD3 – GPIO22
PD4 – GPIO27
PD5 – GPIO28
PD6 – GPIO29
PD7 – GPIO30
PE0 – GPIO8
PE1 – GPIO9
PE2 – GPIO10
Digital Input:
The microcontroller has numerous input pins, each of which has an input pull-up resistor. The number of input pins on the PIC16F887 is greater than all other pins, and they can be utilized to wake up the microcontroller if it is sleeping. These pins are compatible with all other CMOS devices and peripherals since they can function at TTL/ST logic. The following is a list of all input pins:
PA0 – GPIO2
PA1 – GPIO3
PA2 – GPIO4
PA3 – GPIO5
PA4 – GPIO6
PA5 – GPIO7
PA6 – GPIO14
PA7 – GPIO12
PB0 – GPIO33
PB1 – GPIO34
PB2 – GPIO35
PB3 – GPIO36
PB4 – GPIO37
PB5 – GPIO38
PB6 – GPIO39
PB7 – GPIO40
PC0 – GPIO15
PC1 – GPIO16
PC2 – GPIO17
PC3 – GPIO18
PC4 – GPIO23
PC5 – GPIO24
PC6 – GPIO25
PC7 – GPIO26
PD0 – GPIO19
PD1 – GPIO20
PD2 – GPIO21
PD3 – GPIO22
PD4 – GPIO27
PD5 – GPIO28
PD6 – GPIO29
PD7 – GPIO30
PE0 – GPIO8
PE1 – GPIO9
PE2 – GPIO10
PE3 – GPIO1
How to Program PIC16F887 Microcontroller
The PIC microcontroller can be programmed using a variety of software available on the market. There are still people that program PIC MCUs in Assembly language. The following information pertains to Microchip's most advanced and widely used software and compiler.
An IDE (Integrated Development Environment), which is where the programming takes place, is required to program the PIC microcontroller. A compiler converts our software into HEX files, which can be read by MCUs. Our hex file is dumped into our PIC MCUs using an IPE (Integrated Programming Environment).
IDE: MPLABX v3.35
IPE: MPLAB IPE v3.35
Compiler: XC8
We'll need a gadget called PICkit 3 to dump or upload our code into PIC.
Interface the hardware (programmer kit) to the computer through a serial cable
Place the microcontroller in the socket of the hardware kit. Press the lock button to ensure the microcontroller is connected to the board.
Open the software installed on the computer. This shows the menu bar with file, functions, open, save, and setting options.
Select the ‘open’ option from the drop-down menu and select the ‘load file’.
Click on the ‘load’ button so that the hex file is loaded into the microcontroller.

Code Loading to PIC MIcrocontroller
The PICkit 3 programmer/debugger is a low-cost in-circuit debugger controlled by a PC running MPLAB IDE (v8.20 or higher) on a Windows platform. The PICkit 3 programmer/debugger is a must-have tool for any development engineer. Other gear will be required, such as a perf board or breadboard, a soldering station, PIC ICs, Crystal oscillators, capacitors, and so on.
Parts with Similar Specs
- ImagePart NumberManufacturerPackage / CaseNumber of PinsData Bus WidthNumber of I/OInterfaceMemory SizeSupply VoltagePeripheralsView Compare
PIC16F887-E/P
40-DIP (0.600, 15.24mm)
40
8 b
35
I2C, SPI, UART, USART
14 kB
5 V
Brown-out Detect/Reset, POR, PWM, WDT
40-DIP (0.600, 15.24mm)
40
8 b
36
I2C, SPI, UART, USART
14 kB
3.3 V
Brown-out Detect/Reset, POR, PWM, WDT
40-DIP (0.600, 15.24mm)
40
8 b
36
I2C, LIN, SPI, UART, USART
14 kB
-
Brown-out Detect/Reset, POR, PWM, WDT
40-DIP (0.600, 15.24mm)
40
8 b
36
I2C, LIN, SPI, UART, USART
14 kB
-
Brown-out Detect/Reset, POR, PWM, WDT
PIC16F887 Manufacturer
Microchip Technology Inc. is a leading provider of microcontroller and analog semiconductors, providing low-risk product development, lower total system cost, and faster time to market for thousands of diverse customer applications worldwide. Headquartered in Chandler, Arizona, Microchip offers outstanding technical support along with dependable delivery and quality.
Trend Analysis
Datasheet PDF
- Datasheets :
- PCN Packaging :
- PCN Design/Specification :
- ConflictMineralStatement :
How much program memory is on the PIC16F887?
It is 14.
Which port in PIC 16f887 has four pins?
PIC16F887 comes with multiple power pins. It has four power pins and all pins can be used at the same time. Power pins are connected internally. Two pins are for ground and the other two are for power input.
How many input output pins are there in PIC16F887?
It has a total number of 40 pins and there are 33 pins for input and output. PIC16F877A is used in many pic microcontroller projects.
How many IO ports are there in PIC16F877A?
IT has 5 Ports in total. (PortA, PortB, PortC, PortD and PortE). It supports Serial Communication for which it has 2 Pins TX and RX.
How many analog pins are in PIC16F877A?
PIC16F877A has an inbuilt 10-bit Successive Approximation ADC which is multiplexed among 8 input pins.
PMEG6010CEJ Schottky Diode: Datasheet PDF, Application, Alternative15 February 20222596
BT137 Triacs: Circuit, Pinout, and Datasheet [Video&FAQ]02 December 202135799
Renesas DF2268FA20V Technical Datasheet: Features, Applications, and Reference Designs29 February 2024133
MJE13007 NPN Bipolar Power Transistor: Equivalent, Datasheet and Pinout22 October 202129215
TCRT5000L:Datasheet, Package, and Manufacturer14 March 20222060
AD202 2000V Isolation Amplifier: Datasheet, Pinout, and Performance Deep Dive03 March 2026339
IRF830 Power MOSFET: Pinout, Datasheet, and Test Circuit14 July 20215583
A Comprehensive Guide to the 5962-8770203RX Digital to Analog Converter (DAC)06 March 2024169
Introduction to Synchronous Counter and Asynchronous Counter31 March 202518424
800G Optical Transceivers: The Guide for AI Data Centers24 December 202510992
Voltage Follower: Purpose, Working, and Circuits27 March 202528483
What is an LDO (Low Dropout Regulator)?29 October 20216451
Review of IoT-Based Smart Home Security Systems- Part 128 March 20243983
Best Practices for Panel Meter Maintenance11 July 20251405
Introduction to TTL and CMOS Logic Gate Circuits24 November 202522796
How do Solar Cells Work?20 November 20203139
Microchip Technology
In Stock: 1486
United States
China
Canada
Japan
Russia
Germany
United Kingdom
Singapore
Italy
Hong Kong(China)
Taiwan(China)
France
Korea
Mexico
Netherlands
Malaysia
Austria
Spain
Switzerland
Poland
Thailand
Vietnam
India
United Arab Emirates
Afghanistan
Åland Islands
Albania
Algeria
American Samoa
Andorra
Angola
Anguilla
Antigua & Barbuda
Argentina
Armenia
Aruba
Australia
Azerbaijan
Bahamas
Bahrain
Bangladesh
Barbados
Belarus
Belgium
Belize
Benin
Bermuda
Bhutan
Bolivia
Bonaire, Sint Eustatius and Saba
Bosnia & Herzegovina
Botswana
Brazil
British Indian Ocean Territory
British Virgin Islands
Brunei
Bulgaria
Burkina Faso
Burundi
Cabo Verde
Cambodia
Cameroon
Cayman Islands
Central African Republic
Chad
Chile
Christmas Island
Cocos (Keeling) Islands
Colombia
Comoros
Congo
Congo (DRC)
Cook Islands
Costa Rica
Côte d’Ivoire
Croatia
Cuba
Curaçao
Cyprus
Czechia
Denmark
Djibouti
Dominica
Dominican Republic
Ecuador
Egypt
El Salvador
Equatorial Guinea
Eritrea
Estonia
Eswatini
Ethiopia
Falkland Islands
Faroe Islands
Fiji
Finland
French Guiana
French Polynesia
Gabon
Gambia
Georgia
Ghana
Gibraltar
Greece
Greenland
Grenada
Guadeloupe
Guam
Guatemala
Guernsey
Guinea
Guinea-Bissau
Guyana
Haiti
Honduras
Hungary
Iceland
Indonesia
Iran
Iraq
Ireland
Isle of Man
Israel
Jamaica
Jersey
Jordan
Kazakhstan
Kenya
Kiribati
Kosovo
Kuwait
Kyrgyzstan
Laos
Latvia
Lebanon
Lesotho
Liberia
Libya
Liechtenstein
Lithuania
Luxembourg
Macao(China)
Madagascar
Malawi
Maldives
Mali
Malta
Marshall Islands
Martinique
Mauritania
Mauritius
Mayotte
Micronesia
Moldova
Monaco
Mongolia
Montenegro
Montserrat
Morocco
Mozambique
Myanmar
Namibia
Nauru
Nepal
New Caledonia
New Zealand
Nicaragua
Niger
Nigeria
Niue
Norfolk Island
North Korea
North Macedonia
Northern Mariana Islands
Norway
Oman
Pakistan
Palau
Palestinian Authority
Panama
Papua New Guinea
Paraguay
Peru
Philippines
Pitcairn Islands
Portugal
Puerto Rico
Qatar
Réunion
Romania
Rwanda
Samoa
San Marino
São Tomé & Príncipe
Saudi Arabia
Senegal
Serbia
Seychelles
Sierra Leone
Sint Maarten
Slovakia
Slovenia
Solomon Islands
Somalia
South Africa
South Sudan
Sri Lanka
St Helena, Ascension, Tristan da Cunha
St. Barthélemy
St. Kitts & Nevis
St. Lucia
St. Martin
St. Pierre & Miquelon
St. Vincent & Grenadines
Sudan
Suriname
Svalbard & Jan Mayen
Sweden
Syria
Tajikistan
Tanzania
Timor-Leste
Togo
Tokelau
Tonga
Trinidad & Tobago
Tunisia
Turkey
Turkmenistan
Turks & Caicos Islands
Tuvalu
U.S. Outlying Islands
U.S. Virgin Islands
Uganda
Ukraine
Uruguay
Uzbekistan
Vanuatu
Vatican City
Venezuela
Wallis & Futuna
Yemen
Zambia
Zimbabwe


Product
Brand
Articles
Tools







