PIC – Introduction

The term PIC, or Peripheral Interface Controller, has been coined by Microchip technology to identify its single chip microcontrollers. PIC microcontrollers possess an array of features that make them attractive for a wide range of applications. Furthermore these microcontrollers are available with a range of capabilities, packaged in both dual-in-line(DIP) packages and surface-mount packages. Factors that account for the wide popularity of PIC microcontrollers include the following:

  • Speed: When operated at its maximum clock rate, a PIC executes most of its instructions in 0.2µs, or 5 instructions per microsecond.
  • Instruction set simplicity: The instruction set consists of just 35 instructions.
  • Integration of operational features: Power-on Reset and Brown –out protection insure that the chip operates only when the supply voltage is within specification. A watchdog timer resets the PIC if the chip ever malfunctions and deviates from its normal operations.
  • Programmable timer options: The versatile timers can characterize inputs, control outputs and provide timing for program execution.
  • Interrupt control: Up to 12 independent interrupt sources can control when the CPU will deal with each source.
  • Powerful output pin control: A single instruction can select and drive a single output pin high or low in its 0.2µs instruction execution time. The pin can drive a load of up to 25mA.
  • I/O port expansion:  The built-in serial peripheral interface can make use of standard 16-pin shift register parts to add any number of I/O pins.
  • Serial programming via two pins: The simplicity of programming hardware supports the availability of PIC programmers for under $100.

PICs use a RISC instruction set, which varies in length from about 35 instructions for the low-end PICs to about 70 instructions for the high-end PICs. The instruction set includes instructions to perform a variety of operations on the accumulator and a constant or the accumulator and a memory location, as well as for conditionally executing code and jumping/calling other parts of the program and returning from them, and specific hardware features like interrupts and one low-power mode called sleep. Microchip provides a freeware IDE package called MPLAB, which also includes a software simulator as well as an assembler.

The word size of PICs is a source of much confusion. All PICs (except dsPICs and PIC24s) handle data in 8-bit chunks, so they should be called 8-bit microcontrollers. But unlike most CPUs, PICs use Harvard architecture, so the size of an instruction can be different from the size of the data. In fact, different PIC families use different instruction sizes, which make it a challenge to compare the code size of PICs to other microcontrollers. For example, say a microcontroller has 6144 bytes of program memory. For a 12-bit PIC, this works out to 4096 words (or assembly instructions); for a 16-bit PIC, this is 3072 words.
PICmicro devices are grouped by the size of their instruction word and their instruction set. The four current PICmicro families and their instruction word length are:

  1. Base-Line:    12-bit instruction Word length
  2. Mid-Range:  14-bit instruction Word length
  3. High-End:     16-bit instruction Word length
  4. Enhanced:    16-bit instruction Word length

The PIC18FXXX MCU family belongs to the Enhanced MCU family of devices. These devices have full-speed USB support, all sorts of inbuilt hardware and are very powerful and versatile.

Microchip offers three program memory types. The memory type is designated in the part number by the first letter(s) after the family affiliation designators.

  1. C, as in PIC18CXXX. These devices have EEPROM type memory.
  2. CR, as in PIC18CRXXX. These devices have ROM type memory.
  3. F, as in PIC18FXXX. These devices have FLASH type memory.

The PIC18FXXX family offers the advantages of all PIC18 microcontrollers-namely, high computational performance at an economical price-with the addition of high-endurance, Enhanced flash program memory.

Microchip offers a wide range of development tools that allows users to efficiently develop and debug application code. Microchip’s development tools can be broken down into four categories:

  1. Code generation
  2. Hardware/Software debug
  3. Device programmer
  4. Product evaluation boards

All tools developed by Microchip operate under the MPLAB@ Integrated Development Environment (IDE).

2 Responses to “PIC – Introduction”

  1. Bobby Williams

    I need to write a program using 2 PIC 16f84a microchips. I am using two circuit boards, one for the input chip and one for the output chip. 8 dip switches for the input circuit board and chip and 8 LED’s for the output circuitboard and chip. I can only use three wires between the boards to control the two chips. The project is to be able to turn on the switch to light the corrosponding LED. If I turn on all the switches, all of the LED’s will come on. Can you help me please



Leave a Reply