Chapter 1: PIC16F887 Microcontroller – Device Overview

The PIC16F887 is one of the latest products from Microchip. It features all the components which modern microcontrollers normally have. For its low price, wide range of application, high quality and easy availability, it is an ideal solution in applications such as: the control of different processes in industry, machine control devices, measurement of different values etc. Some of its main features are listed below.Book PIC Microcontrollers

  • RISC architecture
    • Only 35 instructions to learn
    • All single-cycle instructions except branches
  • Operating frequency 0-20 MHz
  • Precision internal oscillator
    • Factory calibrated
    • Software selectable frequency range of 8MHz to 31KHz
  • Power supply voltage 2.0-5.5V
    • Consumption: 220uA (2.0V, 4MHz), 11uA (2.0 V, 32 KHz) 50nA (stand-by mode)
  • Power-Saving Sleep Mode
  • Brown-out Reset (BOR) with software control option
  • 35 input/output pins
    • High current source/sink for direct LED drive
    • software and individually programmable pull-up resistor
    • Interrupt-on-Change pin
  • 8K ROM memory in FLASH technology
    • Chip can be reprogrammed up to 100.000 times
  • In-Circuit Serial Programming Option
    • Chip can be programmed even embedded in the target device
  • 256 bytes EEPROM memory
    • Data can be written more than 1.000.000 times
  • 368 bytes RAM memory
  • A/D converter:
    • 14-channels
    • 10-bit resolution
  • 3 independent timers/counters
  • Watch-dog timer
  • Analogue comparator module with
    • Two analogue comparators
    • Fixed voltage reference (0.6V)
    • Programmable on-chip voltage reference
  • PWM output steering control
  • Enhanced USART module
    • Supports RS-485, RS-232 and LIN2.0
    • Auto-Baud Detect
  • Master Synchronous Serial Port (MSSP)
    • supports SPI and I2C mode

Pin Description

As seen in Fig. 1-1 above, the most pins are multi-functional. For example, designator RA3/AN3/Vref+/C1IN+ for the fifth pin specifies the following functions:

  • RA3 Port A third digital input/output
  • AN3 Third analog input
  • Vref+ Positive voltage reference
  • C1IN+ Comparator C1positive input

This small trick is often used because it makes the microcontroller package more compact without affecting its functionality. These various pin functions cannot be used simultaneously, but can be changed at any point during operation.

The following tables, refer to the PDIP 40 microcontroller.Book PIC Microcontrollers schematic

Central Processor Unit (CPU)

I’m not going to bore you with the operation of the CPU at this stage, however it is important to state that the CPU is manufactured with in RISC technology an important factor when deciding which microprocessor to use.

RISC Reduced Instruction Set Computer, gives the PIC16F887 two great advantages:

  • The CPU can recognizes only 35 simple instructions (In order to program some other microcontrollers it is necessary to know more than 200 instructions by heart).
  • The execution time is the same for all instructions except two and lasts 4 clock cycles (oscillator frequency is stabilized by a quartz crystal). The Jump and Branch instructions execution time is 2 clock cycles. It means that if the microcontroller’s operating speed is 20MHz, execution time of each instruc tion will be 200nS, i.e. the program will be executed at the speed of 5 million instructions per second!


For more detail: Chapter 1: PIC16F887 Microcontroller – Device Overview

About The Author

Ibrar Ayyub

I am an experienced technical writer holding a Master's degree in computer science from BZU Multan, Pakistan University. With a background spanning various industries, particularly in home automation and engineering, I have honed my skills in crafting clear and concise content. Proficient in leveraging infographics and diagrams, I strive to simplify complex concepts for readers. My strength lies in thorough research and presenting information in a structured and logical format.

Follow Us:

Leave a Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.