Using the PICkit3 and PIC18F4550

microcontrollerpicpickitpins

For my microcontrollers class, I am using an advanced 8-bit microprocessor, the PIC18F4550. I am trying to program it with a PICkit 3.

I have used the device datasheet and the PICkit 3 datasheet to connect the pins. Here is the device datasheet and PICkit 3 datasheet (not enough reputation to post images yet).

From these datasheets, I have connected the following pins:

| PICkit pin | 4550 pin  |
|:----------:|:---------:|
| 1          | 1         |
| 2          | 11, 32    |
| 3          | GND       |
| 4          | 40        |
| 5          | 39        |
| 6          |unconnected|

Then I simply plug it into my computer, via USB, and the programming fails (with both the 'power this device from PICkit?' option checked and unchecked). The output I get is below:

PICkit 3 detected
Connecting to PICkit 3...
Firmware Suite Version..... 01.28.40
Fireware type.............. PIC18F
PICkit 3 Connected
PK3Err0045: You must connect a target device to use PICkit 3.
Target Device ID (00000000) does not match expected Device ID (000001200)

Programming...
The following memory regions failed to program correctly.
Program memory
Address 000000000 Expected Value: 000000016 Received Value: 0000000000
Programming Failed

Where is my error? Is my device fried (as some forums suggest) or are my pins connected to the wrong thing? My guess is the latter.

Schematic with connections:

Schematic

Best Answer

I found the answer, and my gosh it was silly. The first part is that I had the pins in the reverse order. I didn't properly look at the datasheet to see where pin 1 was. It is by the arrow.

Second of all, I had connections to the wrong place. I followed the diagram below, and it worked well. Note that Vdd is 5V (supplied by the PICkit 3) and MCLR/NOT(Vpp) is pin 1.

If I had enough rep, I would post the diagram.