![]()
WARNING! PLEASE READ!!! If you have your PICkit 2 connected to your computer AND you have it connected to your project on a breadboard, etc., and you DON'T want power supplied to it yet, make sure you disconnect the VDD output from the programmer prior to taking these next steps. The problem is, MPLAB has the PICkit 2 configured to connect automatically and apply power to the VDD line. This option can be turned off, but not prior to selecting it in MPLAB. This can be disastrous if your circuit isn't ready for power to be applied.
NOTE ABOUT SPECIFIC PROGRAMMER USAGE: As stated at the beginning of this tutorial, we are using the PICkit 2 programmer. Since that is the only MPLAB supported programmer I have ever used with this software, I cannot offer any additional information on other programmers used. To that end, the following images and instructions are for the PICkit 2.
After reading the above warning and note, we are ready to tell MPLAB what programmer we wish to use.
Before we do this, please note that there will be no other options for Programmer except Select Programmer until a programmer is selected. After a programmer is selected, the options for Programmer expand to allow many more options. Some of these will be disabled until the programmer is actually connected. With that said, let us get started.
On the MPLAB main menu, click Programmer / Select Programmer / PICkit 2 as seen in Figure 1.
|
|
| Figure 1 - Select Programmer |
Once you select a programmer (as in PICkit 2 for this tutorial) the options for Programmer expand. Chances are the programmer connected the moment you selected a programmer so you shouldn't see any disabled options. We'll change that in a moment, but for now you should see some more options as shown in Figure 2. Remember that the image assumes the programmer is NOT connected.
|
|
| Figure 2 - Programmer Options |
Click on Settings to set how the IDE handles your programmer. Set your settings to match this. Many of these settings are unclear as to their use. A search of official Microchip documents related to the PICkit 2, MPLAB IDE, and C18 turned up nothing to most of these settings. I have posts posted out there asking for information concerning these settings. I'll update this tutorial as that information comes in. For now, this is what I use and it works just fine. It also allows for manual connection to the programmer on MPLAB start up which in my opinion is a nice safe practice.
Keep in mind that this image and part of the tutorial will change often in the near future so revisit this tutorial for updates. I'll post an update DATE at the top of the tutorial so it will be easier to see if you have seen the latest updates.
|
|
| Figure 3 - PICkit 2 Settings |
| Once you have your settings looking like Figure 3, click |
|
and proceed. |
We will want to connect your programmer in MPLAB eventually, and of course, we will want to physically connect your programmer to your circuit, but we are not ready for that yet. We need to write some code, and we are FINALLY at the fun part of this tutorial.