Special Thanks To: David Meiklejohn, Googligum Electronics
"PIC" refers to an extensive family of microcontrollers manufacture by Microchip Technology Inc.
- see http://www.microchip.com
A microcontroller is a processor which has I/O circuitry and peripherals built-in, allowing to interface more or less directly with real-world devices such as light, switches,sensors and motors. The simplify the design of logic and control system, allowing complex(or simple) behaviors to be designed into a piece of electronic or electromechanical equipment. They represent and approach witch draws on both electronic design and programming skills; an intersection of what was once two disciples, and is now called "embedded design".
Modern microcontrollers make it very easy to get started . They are very forgiving and often need little external circuitry. Among the most accessible are the PIC microconrollers.
The range of PICs available is very broad - from tiny 6-pin 8 bit devices with just 16 bytes (!) of data of memory which can perform only basic digital I/O , to 100-pin 32 bit devices with 512Kb of memory and many integrated peripherals for communication , data acquisition and control.
One of the most confusing aspects of PIC for newcomers is that the low-end devices that have entirely separate address and data buses for data and program instructions. With a PIC described as being 8-bit or 16-bit , this refers to the amount of data that can be process at once - the width of the data memory(registers of Microchip terminilogy) and ALU(arithmetic logic unit).
The low-end PICs, which operate on data 8-bits at a time, are divided into three architectural families:
- Baseline(12-bit instruction)
- This PICs are based on the original PIC architecture, going back to 1970's and General Instrument's "Peripheral Interface Controller". The are quite limited, but, within their locations (such as no interrupts), they are simple to work with -particularly in assembler.
Modern examples include the 6-pin 10F series , the 8-pin 12F509 and the 14-pin 16F506.
- Midrange (14-bit instructions)
- This is an extension of the baseline architecture, adding support for interrupt, more memory and on-chip timers and peripherals, including PWM(pulse width modulation) for motor control, support for serial, I2C and SPI interface and LCD(liquid crystal display) controllers.
Moder examples include the 8-ping 12F629, the 20-pin 16F690 and 40-pin 16F887.
- High-end (16-bit instructions)
- Otherwise known as the 18F series, this architecture overcomes some of the limitations of the midrange devices, providing more memory (up to 128k program memory and almost 4k data memory) and advance peripherals, including USB, ethernet and CAN (controller area network) connectivity.
The 18F architecture designed to support C programming, and is the only one of the 8-bit PIC families for which Microchip offer a C compiler.
Examples include the 18-pin 18F1220, the 28-pin 18F2455, and the 80-pin 18f8520.
This can be a little confusing; the PIC18F series has 16-bit program instruction which operate on data 8-bits at a time, and considered to be 8-bit chip.
We won't consider the 16-bit PIC's such as the PIC24F microcontroller or the dsPIC30 or dsPIC33 digital signal controllers , nor the new 32-bit PIC32MX devices, in this tutorial series.
Development Environment
For PIC development, you'll need:
- A PC, preferably running Windows XP with a spare serial port
- A PIC programmer
- A prototyping environment, such as breadboard
And optionally:
- A C compiler e.g. HI-TECH C
- A simulator e.g. Proteus
PIC PROGRAMMER
These days, PIC's use flash memory, which can be electrically erased - thousands of times, without specialize equipment.
There are many PIC programmers everywhere but I want to introduce to you my DIY universal PIC programmer.. This programmer is a JDM based programmer.
Here is my actual programmer :)



Development Sotfware
Every PIC developer should have a copy of Microchip's MPLAB integrated development environment (IDE) - even if you primarily use third-party tool chain(a set of development tools that work togethere). It includes Microchip's assembler (MPASM), an editor, and a fully-featured software simulator, which allow you to debug your application before committing it to the chip. Not long ago, a development environment as sophisticated as this would have cost thousands. But MPLAB is free, including support from Microchip, so there is no reason not to have it. Download it from Here: MPLAB IDE
MPLAB, from version 7.41, includes a free copy of CCS’s C compiler for the baseline PICs. It’s nice to have, and it is used in the Baseline PIC C Programming tutorial series, but in practice most people wouldn’t use a C compiler on the baseline PICs; resources are so tight that to make the most of them, you need to use assembly. That explains why CCS are able to give away their baseline compiler; few people would have bought it, but it provides a lead into the rest of their range of PIC C compilers