FriendlyWire.com


beginner-friendly electronics tutorials and projects


[[slogan]]

How to flash a PIC microcontroller in 2025: PICKit3 or MPLAB Snap?

September 6, 2025 tutorial

If you want to get started with PIC microcontrollers, you need a programming adapter. The PICKit3 (or one of its many clones) is a very famous choice and works great. But the newest versions of the MPLAB software, starting at version 6.25, no longer support it! So, does that mean you have buy the new and expensive PICkit5 for $100?

No! There are two things you can do:

  • You can just keep using your PICkit3. Simply by switching back to an older version of the MPLAB software that you can still download, for free, from the official archives of the MicroChip website. But in that case, of course you will not be able to get any updates in the future.
  • So if staying up to date is important for you, or you're just getting started with PIC microcontrollers and haven't bought anything yet, you may want to check out the MPLAB Snap instead. It is around $10, which is not too bad, and: this tool is fully supported by the MPLAB software.

But what is the right choice for you? Overall, if you are a beginner and you are just getting started with PIC microcontrollers today, I would still recommend the Snap. But, that's just my opinion. So in the rest of this article we will compare the PICkit3 to the Snap in a bit more detail, so that by the end you can figure out what is the best solution for you if you want to follow any of the projects here on the channel, or get started on your own :)

And, before I forget, this entire tutorial is of course also available as a video on YouTube:

And now, let's get started!

Quick overview

But before we get lost in the details of the PICkit3 and the MPLAB Snap, let's do a quick recap:

When we use microcontrollers we first have the source code on one side, and that is typically written in C so that we as humans can read and understand it easily. Today we will use one written for the PIC16F1455 and it makes an LED blink once per second (we will see how it looks like in one of the next chapters).

Next, we use a compiler to turn that source code into a .hex-file. And that .hex-file looks completely mysterious to us humans when we open it, but it is what our controller can understand. Now, this all happens on our computer, but now we want to transfer—or “flash”—this .hex-file onto our controller. That is where we need a programming adapter, like the PICkit3 or the MPLAB Snap.

Hands-on experience

So here is how they look like, the PICkit3 and the Snap:

The PICkit3 comes with a mini USB connector, and the Snap with a micro USB connector. On the other side they have the single-in-line connector that we will use to program our PIC, but more on that below.

The PICKit3 of course comes in the iconic red housing, but the Snap is just a PCB with some rubber feet on the other side. So it is much smaller, and cheaper to make, but the in my opinion biggest problem is that it is completely unprotected with such an exposed PCB. I mean, a single small piece of wire or solder dropped on the board can short out some traces and damage it permanently.

And that is why I made my own housing for the Snap from red 3mm translucent acrylic and 5mm brass standoffs:

I also added a micro USB to type A adapter to make it less finicky to plug in.

And on the bottom side I added some rubber feet so it does not slide around:

And yes, it's still open from the sides so it's not 100% safe, but I could always add some hot glue in there if I get worried. For what I am doing, it'll do just fine, but if you build your own, you can of course get creative.

All of this did take some time, but I think this makes the Snap really nice and convenient to handle, and I find that ease of use is one of the most important aspects in a programming adapter.

Example project

So let's make an LED blink once per second with the PIC16F1455. This is a pretty straightforward operation on any microcontroller, but what's nice about this example is: we see immediately if the program is working because of the optical feedback, and we also don't need a complicated circuit (just an LED and a resistor, really). The code is fairly simple and mainly revolves around these lines here:

	// main loop
    while (1) {

        // turn LED on and wait 500ms
        LED = 1;
        __delay_ms(500);
        
        // turn LED off and wait another 500ms
        LED = 0;
        __delay_ms(500);
        
    }

You can find the full source code below. And, spoiler alert, this is how it will look like:

Okay, but how do we get here? We begin by creating a new project in the MPLAB X IDE. Under category we select MicroChip Embedded, and under Projects we click on Application Project. Then we click on Next.

For our example here select the PIC16F1455. Under Tools we will leave No Tool selected, because we will use a different program (the MPLAB IPE) to flash our .hex-file later. Then we click on Next.

We skip this step here and click on Next.

Then we select the XC8 compiler and again click on Next.

Now we can set our project name, and I just called it “Blink,” and then we click on Finish.

Then, open the Projects tab on the left-hand side, right click on Source Files, then on New, and then select main.c.

Set “main” as the file name and click on Finish.

Then we can copy & paste our blink source code and click on the Hammer & Broom symbol in the toolbar to compile the code.

After that is done, we can go to the directory of our main.c file, and find the .hex-file in the subfolder dist → default → production.

Now that we have the .hex-file, let us flash it our controller using the PICkit3 and the Snap!

Connections & example circuit

So, now that we have the .hex-file, we can connect our PIC microcontroller to the PICkit3 or the Snap. The connections are identical, they are called Master Clear, VDD, ground, Program Data and Program Clock. VDD and ground is where we connect the power supply, and the other three connections are in charge of transmitting the .hex-file:

And here is how those pins are numbered on the PICkit3 or the Snap:

And here is where you can find those corresponding pins on the the PIC16F1455:

But chances are, of course, that you are using a different controller than the PIC16F1455. But don't worry, they almost always have the same names. Sometimes PGD is called ICSPDAT, and PGC is called ICSPCLK. If in doubt, just reach out to me and I will do my best to get back to you and help you out with your PIC microcontroller :)

And this here is how this looks like for our PIC16F1455 example in a schematic (here for the PICkit3):

And here is the same for the Snap:

You can see: the schematics are exactly the same, switching out the PICkit3 and the Snap is largely cosmetics because the connections to our PIC16F1455 are exactly the same.

We also placed an LED from pin RC3 to ground with a resistor because our example code will make that LED blink once a second, and there is also an optional 4.5V battery pack with an ON/OFF switch that we can use as a power supply for our circuit. And the 100nF capacitor is just there for stability.

And here is how that looks like when we build it on a breadboard in real life.

  • Step 1

    Place the small breadboard in front of you with row 1 facing to the left. The PIC16F1455 goes into row 6 with its pin 1 facing to the left. Place the capacitor C1 between pins 1 and 14, and connect LED1's anode to pin 7.

    Next, connect the LED cathode to resistor by placing the 220Ω resistor in rows 13 and 17. And, last, connect over to the other side, and then up to pin 1, to form the ground rail.

  • Step 2

    Then, connect the five-terminal connecting cable. Master Clear is pin 1 (here in yellow) which goes to pin 4 of the PIC. Pin 2 (red) is VDD, going to pin 1 of the PIC. Pin 3 of the cable is GND (black), going to pin 14 of the PIC. Last, pin 4 of the cable is Program Data (blue) goping to pin 10 of the PIC, and pin 5 of the cable is Program Clock, which is connected to pin 9 of the PIC.

    And, finally, we connect the 4.5V power supply to the PIC. The positive terminal goes to pin 1, and the negative terminal to pin 14. And that's it :)

And then we are ready, and we can open the MPLAB Integrated Programming Environment, or IPE, to flash our .hex-file on to the PIC16F1455. But depending on what programmer we use, the steps will be ever so slightly different because the PICkit3 needs the older version of the MPLAB software that still supports it. And because that is a little bit tricky we will start with that first.

Using the PICkit3

Okay, so we need to download the last PICkit3-friendly version of the MPLAB software. Luckily for us, we can just go to the official MPLAB software archives download page (as usual, all software is available for Windows, Mac, and Linux):

If you have already installed the latest MPLAB software package, like me, and only need the Integrated Programming Environment to use with the PICkit3, then you can select that option here:

That avoids having two copies of the MPLAB X IDE on your system, which is nice because it saves some memory. And after the installation is complete we have both the version 6.20 (the PICkit3-friendly one) and 6.25 (the most recent one, at the time of writing this article) on our system, and we freely choose between them :)

We now plug the breadboard cable into the PICkit3, and then connect the PICkit3 to our computer via USB.

This way, starting up the IPE, version 6.20, you will see the PICkit3 already selected as the Tool:

As the next step, we select the PIC16F1455 under device, and click on Apply...

...and then on Connect. At this point the IPE asks us to make sure that we really connected the PIC16F1455 and if we would like to continue:

...to which we say OK.

At this time, after a few moments, we can get an error message. “Target device was not found (could not detect target voltage VDD):”

This is because we may have forgotten to turn on the external battery pack. So the logical thing would be to turn on the battery pack. Click click on Disconnect, and, sure enough, when we turn on the battery pack and repeat our steps we then see the message “Target device PIC16F1455 found:”

But with the PICkit3 there is another way. To see this, first remove the battery pack:

Then, switch to Settings and then to Advanced Mode:

We enter the password “microchip” and go to the Power Settings tab, where we select Power target circuit from PICkit3.

This tells the PICkit3 to supply the circuit with power, and I find this PICkit3-only option really quite convenient. And once we have turned this feature on, back in the Operate tab, we again click on Disconnect and repeat the previous steps, and then we see the message “Target device PIC16F1455 found.”

We can then select the hex file that we compiled a minute ago by clicking on Browse in the Hex File line:

Then we can click on "Program" and after a few moments we should see the message “Programming complete.”

...and now, our LED should be blinking! We did it!

Using the Snap

And now let's do the same with the Snap, to see what is the same and what is different. So let's disconnect the PICkit3, and replace it with the Snap, and let's not forget to re-connect the battery pack and to turn it on, because the Snap, unlike the PICkit3, always needs a dedicated power supply. And of course we also need to plug the Snap into our computer via USB.

Now we can open the MPLAB IPE, and here we will use the newest version 6.25, and the Snap should already be visible under Tool:

In the line above, type in PIC16F1455...

and click on apply, and then click on Connect:

After a few seconds we should see the message “Target device PIC16F1455 found:”

If not, go back and check your connections, and double check that the battery pack is connected and really turned on. If no external power is supplied, the Snap will show the error message “MPLAB has detected that the low voltage configuration bit on the device is off” which I find a bit misleading, because all it means is that we need to turn on the power. Oh well:

But now that the PIC16F1455 has been detected, we click on Browse in the Hex File line and select the hex-file we created a few minutes ago...

and then we can click on Program:

And then, very quickly, it says “Programming complete.” This part is much faster than with the PICkit3.

But the result is the same, of course: Our LED is blinking :)

Possible problems

So you see, the PICkit3 and the Snap work in a very similar way, but there are also some common pitfalls. So here are some tips and tricks that I hope can come in handy!

Problem #1: using the wrong chip

Microcontroller code is always written specifically for one controller. This example here is for the PIC16F1455, and for that controller only. So keep that in mind when you want to use code from others: it really has to match your controller, otherwise it will not work.

Problem #2: chip is frozen

If you follow all the previous steps, and your LED still does not blink, then: no worries. In that case, inside the MPLAB IPE, click on Settings up in the toolbar, and select Release from Reset:

Because otherwise the PICkit3 or the Snap will keep our microcontroller in reset mode, which will prevent the microcontroller from starting to execute the code that we flashed on it. But now the LED should be blinking, finally.

Problem #3: Reading out a .hex-file

We can also read the .hex-file that we just flashed onto the controller back to our computer. To do that, click on the Read icon...

and wait until it says “Read complete:”

Then click on FileExportHex ...

...and you can save what we just extracted from the controller as a .hex-file:

This always works, as long as code protection has not been turned on, and it can be really useful if you are trying to replicate an old project for which you no longer have the source code. (Ask me how I know...)

Problem #4: MPLAB Snap and configuration bits

This part is very important: the Snap only supports low-voltage programming.

This is why in our code, inside the configuration bits at the top, we need to set Master Clear Enable to ON and we have to set Low Voltage Programming to ON as well, like in our example code right here.

So, what's the problem? When using high voltage programming instead, the Master Clear pin can be used as an additional digital input by our software. This is really useful, especially for smaller chips like the PIC16F1455. But: the Snap doesn't support high voltage programming, only low voltage programming. Yes, I made a cartoon for that, to soften the blow that we cannot use Master Clear as an input when using the Snap.

But, just to see what happens, let's take open the sample code in the MPLAB X IDE and change the Master Clear Enable and Low Voltage Programming bits in the configuration bits, both from ON to OFF.

After compiling this code we can take a look at .hex-file, and comparing it with the previous one we can see that they are a little bit different from each other right here:

Back inside the IPE, when we now load this .hex-file and click on program, the Snap notices that difference, and lets us know that it cannot proceed without changing the Master Clear Enable configuration bit:

And even if clicking Yes it still throws an error message because the Low Voltage Programming bit has the incorrect value because we turned it to OFF.

This leaves us with no choice but to set both “Low Voltage Programming” and “Master Clear Enable” back to ON. For this example it's not a problem, but unfortunately all of the codes on this channel here have “Low Voltage Programming” and “Master Clear Enable” turned to OFF. And two projects here (the new and improved binary clock and the DS1302 real-time clock tutorial), for example, actually use the Master Clear pin as a digital input:

This means that for those projects you actually have to use the PICkit3, or one of its clones, as a programmer.

Summary

So, yeah, this last part is a bit of a downer, but also not the end of the world. So, what is my advice?

  • As a beginner, take the Snap. If you really want to build a project exactly as I show in my videos, use the PICkit3 or one of its clones if you don't want to run into problems with the low voltage programming issue.
  • But keep in mind that the PICKit3 needs the old version of the MPLAB software package, and this may be a problem when our computers or operating systems change in the future. This is why I am thinking of re-activating my old Windows 10 office PC as a permanent PICKit3 programming station.
  • So I would say that as a hobbyist, the combination of PICkit3 and Snap covers you for almost everything.
  • If you are running a MakerSpace or are interested in getting to know the newest, cutting edge PIC microcontrollers, then the best solution for you is the more expensive PICkit5, but your budget is most likely going to reflect that :)

But here is my most important advice: go and get started! The best tool is the tool that you have. Thank you so much for reading, let me know if you have any questions, and I will see you next time :)

Appendix: source code

Here you can find the full source code. The code (as well as the .hex file) are also available for download in the resources box.

/*
 * File:   main.c
 * Author: boos
 *
 * Created on April 13, 2025, 5:12 PM
 */

// CONFIG1
#pragma config FOSC = INTOSC    // Oscillator Selection Bits (INTOSC oscillator: I/O function on CLKIN pin)
#pragma config WDTE = OFF       // Watchdog Timer Enable (WDT disabled)
#pragma config PWRTE = OFF      // Power-up Timer Enable (PWRT disabled)
#pragma config MCLRE = OFF      // MCLR Pin Function Select (MCLR/VPP pin function is digital input)
#pragma config CP = OFF         // Flash Program Memory Code Protection (Program memory code protection is disabled)
#pragma config BOREN = ON       // Brown-out Reset Enable (Brown-out Reset enabled)
#pragma config CLKOUTEN = OFF   // Clock Out Enable (CLKOUT function is disabled. I/O or oscillator function on the CLKOUT pin)
#pragma config IESO = ON        // Internal/External Switchover Mode (Internal/External Switchover Mode is enabled)
#pragma config FCMEN = ON       // Fail-Safe Clock Monitor Enable (Fail-Safe Clock Monitor is enabled)

// CONFIG2
#pragma config WRT = OFF        // Flash Memory Self-Write Protection (Write protection off)
#pragma config CPUDIV = CLKDIV6 // CPU System Clock Selection Bit (CPU system clock divided by 6)
#pragma config USBLSCLK = 48MHz // USB Low Speed Clock Selection bit (System clock expects 48 MHz, FS/LS USB CLKENs divide-by is set to 8.)
#pragma config PLLMULT = 3x     // PLL Multiplier Selection Bit (3x Output Frequency Selected)
#pragma config PLLEN = ENABLED  // PLL Enable Bit (3x or 4x PLL Enabled)
#pragma config STVREN = ON      // Stack Overflow/Underflow Reset Enable (Stack Overflow or Underflow will cause a Reset)
#pragma config BORV = LO        // Brown-out Reset Voltage Selection (Brown-out Reset Voltage (Vbor), low trip point selected.)
#pragma config LPBOR = OFF      // Low-Power Brown Out Reset (Low-Power BOR is disabled)
#pragma config LVP = OFF        // Low-Voltage Programming Enable (High-voltage on MCLR/VPP must be used for programming)

#include <xc.h>

// define LEC location
#define LED RC3

// set frequency variable to 4MHz (needed by the __delay_ms function)
// (note: frequency needs to be set to 4MHz separately, this is just a variable)
#define _XTAL_FREQ 4000000

// main function
void main (void) {
    
    // set internal oscillator to 4MHz
    IRCF0 = 1;
    IRCF1 = 0;
    IRCF2 = 1;
    IRCF3 = 1;
    
    // turn off ADC on RC3
    ANSC3 = 0;
    
    // set RC3 to digital output
    TRISC3 = 0;

    // main loop
    while (1) {

        // turn LED on and wait 500ms
        LED = 1;
        __delay_ms(500);
        
        // turn LED off and wait another 500ms
        LED = 0;
        __delay_ms(500);
        
    }

    return;
    
}

About FriendlyWire

Beginner-friendly electronics tutorials and projects. Discover the joy of electronics! Keep reading.

Let's build a community

How did you get interested in electronics? What do you want to learn? Connect and share your story!

Tag Cloud

  • PIC microcontroller
  • PICkit3
  • MPLAB Snap
  • How to program a PIC microcontroller
  • MPLAB X IDE
  • XC8 compiler
  • MPLAB IPE
  • .hex-file
  • tutorial