8

I have a PIC12F675 that I need to program. I'm using a Pickit 2 and the Pickit 2 software. Supposedly I should be able to program it using this circuit, but the Pickit 2 software is not detecting the chip at all.

circuit

What's going wrong?

EDIT: I've added an image of my circuit breadboarded out. And here is where you can find the datasheet for the PIC12F675. Skip to page 4 for the pinout.

Breadboard

EDIT2: I just actually looked at the chips (dumb, but I kind of assumed mouser would send me what I ordered), and I noticed they're actually PIC12C671's. How much of a difference would this make?

Final EDIT: Wow! Thanks to everyone that helped me with this! I was not expecting this kind of response. It ended up being a small stupid problem just like I thought it would be. It was my fault for not double checking everything when I received the package from Mouser.

Willem Ellis
  • 327
  • 2
  • 3
  • 10

3 Answers3

10

A possible problem is that some PICs need a power-cycle to get into programming mode. The 12F675 in particular needs this when the configuration word in your application configures the MCLR pin as GPIO.

When the pcikit2 powers your target chip it will provide the power cycle. With the independent +5V you supply it can't do this.


After covering the most probable problems you might go for the improbable ones... Don't laugh at me, I am drawing on my own experience!

  • could you have two pickit2's connected? (Yes, I once did this and was flabbergasted that the one the pickit2 application selected was not the one the PIC was connected to. I hve also once wasted an hour when I had two target PICs wires in parallel. That gives very strange results when they both put their chip ID out to the programmer. )
  • is the pickit2 you are using connected to the PC you are using? (I do PIC classes and the students can get quite creative in who's laptop connects to who's PIC)
  • are both the pickit2 and the chip the right side round? The pickit2 pciture is as seen from above (where the button and LEDs are).
  • is the chip really a 12F675? (I once tried for full day to get the A/D converter of a 12F629 working - for the non-PIC-guru's: that's the cheaper brother of the 12F675, it is cheaper because it does not have an A/D converter).
  • Are the wires exactly as you show them, not mixed up? And are they not by any accident broken? If you are using a solderless breadboard: does it still make all the contacts?
  • Is the firmware in the pickit2 a version that matches your PC side? maybe re-load the firmware to be 100% sure.

In response to your EDIT2: ROFL, check my bullet 4. The PIC12C671 is a totally different chip, and the C means it is an EPROM (one-time-programmable) chip, which is not supported by pickit2.

Wouter van Ooijen
  • 48,407
  • 1
  • 63
  • 136
5

The PICkit2 programmer should work as-is for your part without any headers. (Debugging is another matter altogether.)

As well as the decoupling capacitor advice that was offered, consider this: most (all) PIC devices need a 10k pullup from _MCLR to VDD. Try adding that and see what happens.

PICkit2 support

Here's a wiring example from the PICkit3 setup poster. (The pinouts of the PICkit2 and PICkit3 are identical, so the information is 100% relevant.)

ISCP diagram

You can see that the programmer's pins 1 through 5 need to be connected to your circuit. Your schematic is missing the VDD Target connection from pin 2. Try connecting this and allowing the PICkit2 to power the circuit.

Adam Lawrence
  • 32,921
  • 3
  • 58
  • 110
  • 3
    The lack of a resistor on MCLR won't stop the PICkit programming the device. It might stop the program from running, though. – Leon Heller Mar 26 '13 at 18:25
  • I added the pull-up in and made sure I had the correct device selected in MPLAB. Still no dice. – Willem Ellis Mar 26 '13 at 18:49
  • @LeonHeller I based my statement about _MCLR on the PICkit3 poster, which shows the _MCLR pull-up under the "correct" way of wiring things. – Adam Lawrence Mar 26 '13 at 20:55
  • @Madmanguruman I wish I didn't have it hooked up exactly like this, but I verified with the datasheet and all the connections are correct. – Willem Ellis Apr 07 '13 at 21:17
3

PICKit2 does support your device (source). This means there is something wrong with your setup. There are some things you can check:

  • Is there a problem in the communication with PICKit? No, if this would be the case, you would get an error that the ICSP tool couldn't be found.
  • Is there a problem with the circuit with the chip? Possibly. You should check your circuit, add decoupling capacitors if not done yet. All VDD and VSS pins should be connected, also those of the ICSP connector. Also, check your power supply: is it smooth?
  • Is there a software problem? Most likely, I'd say. Have you selected the right chip in MPLAB? Can you program other chips with the same setup?
  • I checked all of this. Added in the decoupling caps and the MCLR pull-up resistor. I'm using the PICKit2 v2.61 software for programming the chip, instead of MPLAB. Although I did try what you said in MPLAB. I get this error when I try to connect to the chip. Please verify that a PIC12F675 is correctly installed in the application – Willem Ellis Mar 26 '13 at 18:47
  • @WillemEllis Very well. I thought of something else: did you connect _all_ Vdd and Vss pins of the chip? Also check if PGC is connected to PGC and not to PGD - this caused me some trouble lately. –  Mar 26 '13 at 18:52
  • @WillemEllis any progress on this one? –  Mar 29 '13 at 08:12
  • sorry for taking so long to get back to you. Unfortunately, no. I talked to my professor and he couldn't figure it out either. I have made sure everything is connected as in the circuit with PGD and PGC going to the correct pins. Still no luck. – Willem Ellis Apr 07 '13 at 21:11
  • If you are certain that your connections are good, try another device or another PICkit2. – Adam Lawrence Apr 07 '13 at 22:38
  • @WillemEllis that's a good idea from Madmanguruman. To make sure the chip / programmer aren't broken. After that, I'm afraid I have no idea either. Perhaps a picture of the setup to check the schematic and so, but nothing brilliant comes up. –  Apr 08 '13 at 05:37
  • @WillemEllis **never mind, see Wouter van Ooijen's edit on his answer. Your chip isn't reprogrammable!** –  Apr 08 '13 at 05:42
  • The PICkit 2 does not *natively* support your device. However, this wonderful PICkit- (PICkitminus) has been updated to support all sorts of devices! http://kair.us/projects/pickitminus/ – Colin Jul 26 '22 at 02:25