Difference between revisions of "PIC Programming with the PICkit 3"

From DiyLightAnimation
Jump to: navigation, search
(Initial (partial) posting)
 
(Added more to initial posting.)
Line 12: Line 12:
  
 
*1. Connect the PICkit 3 programmer to the PIC interface adapter (see [[Bare bones PIC18F programmer interface]] as an example). Make sure any required jumpers are properly configured for the device to be programmed (this will be specific to your PIC interface adapter).
 
*1. Connect the PICkit 3 programmer to the PIC interface adapter (see [[Bare bones PIC18F programmer interface]] as an example). Make sure any required jumpers are properly configured for the device to be programmed (this will be specific to your PIC interface adapter).
*2. Plug the USB interface cable into the PICkit 3 programmer, and the other end into your PC's USB jack.
+
*2. Insert the device into the device socket on your PIC interface adapter. Make sure the device is oriented correctly for your adapter. Close the lever on the socket (if the socket is so equipped).
*3. Start the MPLAB IDE software by double-clicking the icon on your desktop (if you had the installer place an icon there), or by going to the Start menu, and selecting All Programs > Microchip > MPLAB IDE v8.43 [your version may be different] > MPLAB IDE.
+
*3. Plug the USB interface cable into the PICkit 3 programmer, and the other end into your PC's USB jack.
 +
*4. Start the MPLAB IDE software by double-clicking the icon on your desktop (if you had the installer place an icon there), or by going to the Start menu, and selecting All Programs > Microchip > MPLAB IDE v8.43 [your version may be different] > MPLAB IDE.
 +
*5. Import the PIC firmware .HEX file (that you downloaded in Preliminary step #3) by clicking on File > Import... and browsing to the .HEX file. Click on the .HEX file then click "Open". In the "Output" window within MPLAB IDE, you will see that the Build tab now shows that the .HEX file was loaded. You will also see that the file checksum is displayed in the MPLAB status line - confirm that this is the correct value by comparing it to the expected value (which is noted with the firmware file on the WIKI). If the value is not the same, you should re-download the firmware file, as it may have been corrupted during the download.
 +
*6. Configure MPLAB IDE for the PIC device you will program by clicking on Configure > Select Device... and then using the "Device:" pull-down to select the correct device number. Click "OK".
 +
*7. Configure MPLAB IDE to use the PICkit 3 programmer by clicking on Programmer > Select Programmer > "4 PICkit 3". The "PICkit 3" tab will now open in the Output window, and programmer diagnostics will be executed. Note, the first time the programmer is selected, the programmer firmware may be (automatically) updated. This is nothing to worry about.
 +
'''At the end of the diagnostic process, an error will probably be displayed saying "You must connect to a target device to use PICkit 3". This error is displayed because the (connected) device can not yet be detected. We'll fix this in a second...'''
 +
*8. Unless the PIC device is in an active (powered) circuit, configure the PICkit 3 to provide the power to the PIC by clicking on Programmer > Settings..., clicking on the Power tab and clicking "Power target circuit from PICkit 3".  Leave the voltage setting alone, unless you know for certain that it needs to be set to a different value. For the PIC18F2450 used on the DMX Dongle, this should be "5.000". Click "Apply". A Voltage Caution message will be displayed, suggesting that you check to make certain that the correct device is inserted in the socket. After checking that the connected PIC device is the same as what is reported in the Caution message, click "OK" (if the device does not match the configuration, click "Cancel" and make whatever adjustments are necessary).

Revision as of 19:14, 8 January 2010

Getting started with the PICkit 3 programmer - a step-by-step PIC programming guide

Preliminary steps

  • 1. Download the latest MPLAB IDE software (see the WIKI Software section for links).
  • 2. Install the software to your system - unzip the downloaded file & double-click on Setup.exe. Follow all instructions, to complete the installation.
  • 3. Download the firmware for the PIC device you wish to program. This should be downloaded from the WIKI Equipment page.


Setting up to program your device

  • 1. Connect the PICkit 3 programmer to the PIC interface adapter (see Bare bones PIC18F programmer interface as an example). Make sure any required jumpers are properly configured for the device to be programmed (this will be specific to your PIC interface adapter).
  • 2. Insert the device into the device socket on your PIC interface adapter. Make sure the device is oriented correctly for your adapter. Close the lever on the socket (if the socket is so equipped).
  • 3. Plug the USB interface cable into the PICkit 3 programmer, and the other end into your PC's USB jack.
  • 4. Start the MPLAB IDE software by double-clicking the icon on your desktop (if you had the installer place an icon there), or by going to the Start menu, and selecting All Programs > Microchip > MPLAB IDE v8.43 [your version may be different] > MPLAB IDE.
  • 5. Import the PIC firmware .HEX file (that you downloaded in Preliminary step #3) by clicking on File > Import... and browsing to the .HEX file. Click on the .HEX file then click "Open". In the "Output" window within MPLAB IDE, you will see that the Build tab now shows that the .HEX file was loaded. You will also see that the file checksum is displayed in the MPLAB status line - confirm that this is the correct value by comparing it to the expected value (which is noted with the firmware file on the WIKI). If the value is not the same, you should re-download the firmware file, as it may have been corrupted during the download.
  • 6. Configure MPLAB IDE for the PIC device you will program by clicking on Configure > Select Device... and then using the "Device:" pull-down to select the correct device number. Click "OK".
  • 7. Configure MPLAB IDE to use the PICkit 3 programmer by clicking on Programmer > Select Programmer > "4 PICkit 3". The "PICkit 3" tab will now open in the Output window, and programmer diagnostics will be executed. Note, the first time the programmer is selected, the programmer firmware may be (automatically) updated. This is nothing to worry about.

At the end of the diagnostic process, an error will probably be displayed saying "You must connect to a target device to use PICkit 3". This error is displayed because the (connected) device can not yet be detected. We'll fix this in a second...

  • 8. Unless the PIC device is in an active (powered) circuit, configure the PICkit 3 to provide the power to the PIC by clicking on Programmer > Settings..., clicking on the Power tab and clicking "Power target circuit from PICkit 3". Leave the voltage setting alone, unless you know for certain that it needs to be set to a different value. For the PIC18F2450 used on the DMX Dongle, this should be "5.000". Click "Apply". A Voltage Caution message will be displayed, suggesting that you check to make certain that the correct device is inserted in the socket. After checking that the connected PIC device is the same as what is reported in the Caution message, click "OK" (if the device does not match the configuration, click "Cancel" and make whatever adjustments are necessary).