Pickit 3 Tutorial : Programming Pic Microcontrollers using Pickit3


PICkit3 USB Programmer/Debugger

Whether you are a professional embedded systems engineer or some hobbyist and possess a passion for micro controllers, a programmer/debugger is the first thing you need to have. In this tutorial we will be looking t the popular PIC Micro controllers, the Pickit3 Programmer and their interfacing.

Pickit3 is an official programmer and debugger for PIC Micro controllers from Microchip Technologies it can be used with all the PIC Micro controller families using MPLAB ide. Its is a USB based device, so it can be connected to a PC using USB interface while it uses a 6 pin interface with the micro controller to be programmed as shown below.

PICkit3 Pin Configuration:

PIN Signal
1MCLR/Vpp
2VDD (Target)
3VSS (Ground)
4PGD
5PGC
6PGM
MCLR pin stands for Master Clear Reset. So when a LOW pulse is applied to this pin the processor will reset terminating all activities an starting the program from beginning . Normally this pin is connected to a pull up resistor to keep the microcontroller from resetting. PICkit3 uses this pin for resetting the target device.

VDD pin is connected to the power pin of the mcirocontroller also called VDD, This is very important your target device must be connected to it's own power supply, PICkit3 uses the VDD pin to read the voltage level for communication.

VSS pin is connected to micro controller ground, simple as that.

PGD  this must be connected to the PGD pin on the target dvice. This pin serves as connection between the microcontroller and the programmer for data transmission.

PGC pin severs the clock between the PICkit3 and the the corresponding PIC device. It provides the clock signal for synchronized communication.

PGM is Low Voltage Enable Pin (LVP) used for micro controllers with low voltage levels like 3.3v

Hardware Interfacing of PIC and PICkit3


The following diagram shows the necessary connections that must be made between the two devices. Please note the pull up resistor that it must be connected  properly and the resistance values can be 10k or above.



Programming the Micro controller


Now that you have completed the physical connections. It's to burn something to the micrcontroller (I mean to program!). To use PICkit3 as I mentioned earlier you must be using an MPLAB ide with any compiler of your choice like C18, XC8 etc. First make sure that the programmer is connected to the pc and is active, after that go to the MPLAB ide, write your favorite code in it. Before you burn the program, it's a good practice to build the project and see if there are any errors or warnings in the code. After building the project click the "Run Project' (as shown in the figures below) and this will take a few seconds you will see multiple lights blinking and if every thing goes perfect your firmware will be programmed into the microcontroller.

Build You  MPLAB Project


Run the Project to burn the HEX file

Important Notes 


The PICkit3 is an ICSP device which is a protected device so don't worry about conecting the power supply pin of the controller to the chip. The programmer has built in feature of high voltage suppression.

PGM pin as said earlier is used for low voltage programming. So you will mostly leave this pin unconnected in most of the 5v PIC micro controllers as it is a special feature of the PICkit3 for programming the 3.3v logic level micro controllers.

The pull up resistor must be sued with MCLR pin and don't use very low value, as it will draw unnecessary current and will result in degradation in power efficiency.


1 comment:

  1. Thanks for your effort and this is helpful. I will suggest that you add a video of this tutorial because I have not been able to use my pickit3 ever since I bought it.

    ReplyDelete