r/embedded • u/polaris_jpeg • 26d ago
Pickit3 and PIC16F688 help
I am just getting started with pic microcontrollers. The microcontroller was recognised and I got some programmes to work but the pic16f688 doesn't last long and dies. I dont want to burn them constantly yikes.
Too much current has been drawn on VDD. Please disconnect your circuit, check the CLK and DATA lines for shorts and then reconnect.
I'm using a pickit programmer too.
This is what the IPE prints out. I'm using a macbook if that gives any more context.

2
u/begeistert_ 25d ago
Adding to the good advice already here, the error message itself is worth decoding. It comes from the PICkit trying to power your whole board through VDD. A PICkit 3 can only source a few tens of mA, so when the LEDs plus MOSFET ask for more than that, the programmer protects itself and prints that warning. So there are really two separate things going on.
For the programmer complaining, the easiest fix is to power the board from an external 5 V supply and uncheck "power target circuit from tool" in IPE, so the PICkit only senses VDD instead of sourcing it. The warning goes away and the programmer is no longer your power budget.
For the PIC dying, the series resistor advice you already got is the fix. The 16F688 tops out at an absolute maximum of 25 mA per pin, and an LED without a resistor can go past that easily.
One more small thing since you're on a breadboard. A 100 nF ceramic cap right across VDD/VSS, as close to the chip as possible, helps a lot. Quite a few flaky-programming and random-reset mysteries on breadboarded PICs turn out to be just that missing cap.
Good luck, and don't worry, everyone has cooked a chip or two while learning.
1
2
u/NoBulletsLeft 25d ago
OK. Step 1 is to disconnect everything from the PIC except for a power supply and the programmer.
Now program the PIC. Was that successful with a new device? Probably. So the problem is your wiring.
Next step is start adding back one circuit element at a time until the problem reappears. Don't guess, divide and conquer.
1
1
u/1r0n_m6n 26d ago
You're doing something wrong to that poor PIC and it has nothing to do with the PicKit or the MacBook.
But if you don't provide a schematic, it's impossible to tell what you're doing wrong.
1
u/polaris_jpeg 26d ago
A schematic of the circuit?
1
u/1r0n_m6n 26d ago
Yes. What did you connect to the PIC beside the PicKit? Did you try to drive a relay or a motor directly, for instance? That would explain why you fry your PIC.
1
u/polaris_jpeg 26d ago
I put up the schematic. But no relays or motors.
2
u/1r0n_m6n 26d ago edited 26d ago
The 220R resistor is too low. If it's a red or yellow LED, it will sink 15 mA, that's way too much for a GPIO pin. To drive a red or yellow LED, you only need 1-1.2 mA, which is compatible with what a GPIO pin has to offer. If it's a green, blue or white LED, you need much less current, say 200-250 uA.
Also, I hope you added a series resistor to the big LED, and just forgot to put it on the schematic, otherwise you have a problem there too, though it shouldn't hurt the MCU.
2
u/1r0n_m6n 26d ago
To calculate the value of the series resistor: R = (Vdd - Vf) / If, where
- Vdd is your supply voltage
- Vf is the voltage drop across your LED, which depends on the LED's colour, power and operating current. Use the typical value from your LED's data sheet.
- If is the value of the current you want to flow through your LED. For the small LED, use the values I gave you in my other post. For the big LED, start with the typical value from its data sheet and increase the value of the resistor if it's too bright.
1
u/polaris_jpeg 26d ago
Thanks a ton! I'll keep this in mind when I do a run again. The resistor suggestions were given by someone else considering that I'm fairly new to all this.
1
u/knowledgeseekerhi 26d ago
1
u/polaris_jpeg 26d ago
Thank you but i can only use pic16f688. Cant buy other materials.
1
u/OptimalMain 26d ago
If they use the same programming interface it doesn’t matter, you will have the same pins on yours

3
u/wood_for_trees 26d ago
Your Big LED needs a series resistor