1
\$\begingroup\$

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

\$\endgroup\$
  • \$\begingroup\$ Do you have GND connected to all \$\text{V}_{\text{SS}}\$ pins? \$\endgroup\$ – Keelan Feb 8 '13 at 20:55
  • \$\begingroup\$ Post a schematic! \$\endgroup\$ – Leon Heller Feb 8 '13 at 21:00
  • \$\begingroup\$ @CamilStaps: Yes, GND is connected to all Vss pins. \$\endgroup\$ – Scott Feb 8 '13 at 22:43
  • \$\begingroup\$ You won't get anywhere until you resolve the target device ID showing up as all zeroes. Is your MCLR pull-up resistor present? Do you have the necessary decoupling capacitors installed at all the supply pins? \$\endgroup\$ – Adam Lawrence Feb 9 '13 at 1:56
  • \$\begingroup\$ Here's a picture of my schematic: i.imgur.com/56gLAzU.png. And yes, I am using a breadboard. I am not using an MCLR pull-up resistors, I think. I am using the decoupling capacitors. \$\endgroup\$ – Scott Feb 9 '13 at 21:57
1
\$\begingroup\$

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.

\$\endgroup\$
0
\$\begingroup\$

The connections look okay, so:
Do you have the power provided from the PicKit3? If so is it set to provide power? (in the settings, you can toggle power on/off) I assume by GND you mean pins 31 and 12? Also, make sure you have a 100nF - 1uF ceramic cap across each pair of power pins.

If you are using MPLABX the setting will look like this - click the spanner at the bottom left (ICD3 shown but the PicKit3 will be similar):

MPLAB Settings

If you do have power, then double check your connections. If you are using a custom connector/lead then make sure it's short as recommended in the datasheet (see pg.35 6.2) Also if you have an oscilloscope handy, probe the lines to make sure there is activity and signal integrity is good.

\$\endgroup\$
  • \$\begingroup\$ That's exactly what I did, and it didn't work. The checkbox did nothing for me. \$\endgroup\$ – Scott Feb 9 '13 at 1:17
  • \$\begingroup\$ In that case, you need to probe the pins to see if any signal is actually present (and correct). Also check power is present at the Vdd pins. If you don't have a scope available then test for continuity and voltage at all relevant points (i.e. from pins to PicKit3, Vdd to ground for voltage, etc) Make sure you probe the pins directly (not the traces leading from them, in case there is a bad connection at the pin itself) Have you got capacitors on the power pins? \$\endgroup\$ – Oli Glaser Feb 9 '13 at 1:45
  • \$\begingroup\$ Is this a dev board you are using or a breadboard or...? A schematic/picture of your setup would help. \$\endgroup\$ – Oli Glaser Feb 9 '13 at 1:49
  • \$\begingroup\$ I am using a breadboard, so Vdd and GND are all connected. If I had enough rep for a diagram, I'd post it. I don't so, here you go: i.imgur.com/56gLAzU.png. \$\endgroup\$ – Scott Feb 9 '13 at 21:55
  • \$\begingroup\$ Okay, thanks - I added it to your post. If you can manage it a picture would be good too. Have you scoped the signals yet? Or tested with a multimeter? \$\endgroup\$ – Oli Glaser Feb 9 '13 at 22:21
0
\$\begingroup\$

I addition to what others have said, tie the PGM pin to ground. Leaving it floating can cause the device to enter programming mode at inconvenient times. You need to do this even if you have disabled LVP in the config words. When the programmer does a bulk erase, all config bits revert to the default state, which includes LVP enabled.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.