PIC Microcontrollers PIC16F877A/PIC16F874A

PIC Microcontrollers PIC16F877A/PIC16F874A: The name PIC is referred to Peripheral Interface Controller.

What is PIC?

A family of Harvard architecture microcontrollers made by Microchip Technology.

Micro Controller : Micro Processor + Peripherals

Read Also: Microprocessor VS Microcontroller| Comparison of Microprocessor and Microcontroller|Difference between Microprocessor and Microcontroller

Derived from the PIC1650 originally developed by General Instrument Microelectronics Division.

The name PIC was originally an acronym for “Programmable Intelligent Computer”.

The name PIC is referred to Peripheral Interface Controller.

It shares some common features with RISC designs

Why PIC is popular?


 low cost ,wide availability with high clock speed
 of low cost or free development tools
 Only 35 instructions to remember
 serial programming and re-programming with flash memory capability
 Its code is extremely efficient, allowing the PIC to run with typically less program memory than its larger
competitors
PIC is very small and easy to implement for non-complex problems and usually accompanies to the microprocessors as an interface


Classification of PIC Microcontrollers

Based on instruction word length


 Base-Line or low end Architectures: 12-bit Instruction Word
length (PIC10FXX,PIC12C5XX,PIC16C5X)
 Mid-Range Architectures : 14-bit Instruction Word length
(PIC16C6X,PIC16C7XX,PIC16F877X)
 High-End Architectures : 16-bit Instruction Word length
(PIC17C4x,PIC17C7xx,PIC18Cxxx, PIC18F452

Based on data length


 8 bit microcontroller (PIC1612F,PIC17F,PIC16F877)
 16 bit microcontroller(dsPIC30F,dsPIC33F, PIC24FX,PIC24H)
 32 bit microcontroller(PIC32FXX,PIC32MX)

The PIC Family: Speed


12C50X – 4MHz
12C67X – 10MHz
16F877 – 20MHz
17C4X/17C7XXX – 33MHz
18CXXX – 40MHz

  • Can use crystals, clock oscillators, or even an RC circuit.
  • Some PICs have a built in 4MHz RC clock, Not very accurate, but requires no external components!
  • Instruction speed = 1/4 clock speed (Tcyc = 4 * Tclk)
  • All PICs can be run from DC to their maximum specified speed:

Clock and Instruction Cycles


Instruction Clock


– Clock from the oscillator enters a microcontroller via OSC1 pin where internal circuit of a microcontroller divides the clock into four even clocks Q1, Q2, Q3, and Q4 which do not overlap.
– These four clocks make up one instruction cycle (also called machine cycle) during which
one instruction is executed.
– Execution of instruction starts by calling an instruction that is next in string.
– Instruction is called from program memory on every Q1 and is written in instruction register on Q4.
– Decoding and execution of instruction are done between the next Q1 and Q4 cycles. On the following diagram we can see the relationship between instruction cycle and clock of the oscillator (OSC1) as well as that of internal clocks Q1-Q4.
– Program counter (PC) holds information about the address of the next instruction.

PIC16F877a instruction cycle
PIC16F877a instruction cycle

The PIC Family: Program Memory

  • Technology: EPROM, FLASH, or ROM
  • It varies in size from one chip to another.




12C50851212bit
instructions
16C7111024 (1k)14bit
instructions
16F877 8192 (8k)14bit
instructions
17C76616384 (16k)16bit
instructions

PIC16F877A Features

  • High Performance RISC CPU:
    Only 35 single word instructions to learn
    Operating speed: DC – 20 MHz clock input DC – 200 ns instruction cycle
    All single cycle instructions except for program branches, which are two-cycle
    PIC Memory
  • The PIC16F877A has an 8192 (8k) 14bit instruction program memory
  • 368 Bytes Registers as Data Memory :
    – Special Function Registers: used to control peripherals and PIC behaviors
    – General Purpose Registers: used to a normal temporary storage space (RAM)
  • 256 Bytes of nonvolatile EEPROM Peripheral Features
  • Timer0: 8-bit timer/counter with 8-bit prescaler
  • Timer1: 16-bit timer/counter with prescaler,can be incremented during Sleep via
    external crystal/clock
  • Timer2: 8-bit timer/counter with 8-bit period register, prescaler and postscaler
  • Two Capture, Compare, PWM modules
  • 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
  • 10-bit, up to 8-channel Analog-to-Digital Converter (A/D)
  • Synchronous Serial Port (SSP) with SPI™(Master mode) and I2C™ (Master/Slave)
  • Universal Synchronous Asynchronous Receiver,Transmitter (USART/SCI) with 9-bit address detection
  • Parallel Slave Port (PSP) – 8 bits wide with external RD, WR and CS controls
  • Brown-out detection circuitry for Brown-out Reset (BOR)

Peripheral Features PIC16F877a


– 5 Digital I/O Ports
– Three timer/counter modules

  • Timer0: 8-bit timer/counter with 8-bit pre-scaler
  • Timer1: 16-bit timer/counter with pre-scaler, can be incremented during SLEEP via
    external crystal/clock
  • Timer2: 8-bit timer/counter with 8-bit period register, pre-scaler and post-scaler
    – A 10-bit ADC with 8 inputs
    – Two Capture, Compare, PWM modules
  • 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
    – Synchronous Serial Port (SSP) with SPI™ (Master mode) and I2C™ (Master/Slave)
    – Universal Synchronous Asynchronous Receiver Transmitter (USART/SCI) with 9-bit
    address detection
    – Parallel Slave Port (PSP) 8-bits wide, with external RD, WR and CS controls

PIC16F877 pin-out

PIC16F877a Pin diagram
PIC16F877a Pin diagram
  1. Features of AVR|AVR Microcontrollers
  2. 8051 ARCHITECTURE|8051 Microcontroller Architecture
  3. 8051 Microcontroller Architecture|RISC and CISC CPU Architectures|HARVARD & VON- NEUMANN CPU Architecture
  4. Microprocessor VS Microcontroller| Comparison of Microprocessor and Microcontroller|Difference between Microprocessor and Microcontroller
  5. Addressing modes of 8051 Microcontroller|8051 Addressing Modes
  6. 8051 Microcontroller Instruction Set|KSEB Sub Engineer Notes
  7. 8051 Microcontroller MCQ|8051 Questions and Answers
  8. Microcontroller|Types of microcontroller
  9. 8051 Microcontroller Notes pdf|8051 microcontroller pdf
  10. Interrupts in 8051|Interrupts in 8051 Microcontroller

Books for Microcontroller 8051

  1. KSEB Sub Engineer and AE Books
  2. The 8051 Micro controller 3rd Edition,by Kenneth Ayala
  3. The 8051 Microcontrollers & Embedded Systems, by Mazidi
  4. 8051 MICROCONTROLLER AND APPLICATIONS FOR BSC
  5. Microcontroller & Embedded Systems for BE

Leave a Comment