As mentioned in the Introduction, I am going to be working with the following until further notice:
- PicKit 2
- MPLAB IDE V8.00
- MPASM V5.14
Here is a picture of my setup:
Q: Some of the wires are not as straight as they should be. Could you fix them?
I am using a 5V (1A) DC adapter as a power source. I cut off the end and attached the banana plugs.
The LED on the top left (with 1KOhm adapter) serves as an ON-light. Also, if anything accidentally shorts, the light turns off. (I will be using 1K resistors for LEDs since they provide an adequate amount of current and because I have many of them. Resistors as low as 270 Ohms may be used safely for regular 20mA LEDs.)
The PicKit 2 package is an In-Circuit Serial Programmer (ICSP). This means that the PIC can stay on the development board during programming. Unfortunately, the programmer did not come with a connector to the PIC so I had to make one.
Unable to find a 6 pin header, I purchased a longer one and cut off 6 pins. I trimmed the long side of the pins to fit into the PicKit and soldered the wires onto the short side, using a red wire to indicate pin 1. Then, I wrapped the black tie thing shown in the picture around the soldered connections to make sure they don’t touch. It turned out ugly, but functional.
I’m not sure where I found the above diagram, but I believe if was some MicroChip PDF.
Looking at the 18F4550 datasheet, the corresponding pins are:
- Vpp (1)
- Vdd (11)
- Vss (12)
- PGD (40)
- PGC (39)
The 18F4550 supports low-voltage programming (using 5V instead of ~11V). To use LVP, the PGM (38) pin needs to be set high. If LVP is disabled, it functions as an I/O pin. (Side note: An HVP programmer must be used to enable LVP on a new PIC. Also, with LVP enabled, PGM (38) no longer functions as an I/O pin.)
The 5V/GND connections on the 18F4550 should be made as follows:
- 5V (11)
- 5V (32)
- GND (12)
- GND (31)
Notice that there are 2 connections for Vdd (5V) and Vss (GND). All four must be made.
I believe that the PicKit programmer can power the chip via these pins, however it is better to use your own power source. Connecting both a 5V signal and the PicKit to pin 11 relieves the programmer (and the USB port) or the unnecessary current draw. Either way, the Vdd pin of the programmer does need to be connected to Vdd on the 18F4550.
I believe this fully describes my setup. Any suggestions or questions about this post can be posted as replies and will (probably) be answered in a timely manner.