• Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Strange PICkit 2 problem - can't program

Status
Not open for further replies.

futz

Active Member
Saturday afternoon (coincidentally almost exactly when this site went down) my PICkit 2 stopped being able to connect to my target 16F88 circuit. I had done nothing out of the ordinary. I'd been programming it many times up to the moment it quit working with no problems whatsoever.

I scratched my head and thought maybe I killed the PIC. So I changed chips. No change.

I changed power supplys, both the on-breadboard and then the wall wart. No change.

I took a bare breadboard and built a bare minimum 16F88 circuit. No change. I plugged the 16F628 in there. No change.

I redownloaded the OS. More than once. No change.

Shut down and restarted the computer and replugged the programmer. No change.

I changed the USB cable. No change. Plugged in a powered USB hub and plugged into that. No change.

I took the PICkit 2 off and plugged in the Junebug. No change. Right here is when I really started to worry!

Plugged into my 18F4525 balancing robot. No change.

Tried all kinds of combinations of extra capacitors on the breadboard. No change. My power supply already has caps, so the on-breadboard ones are kind of redundant anyway.

This is freaking me out! Any ideas?

One hint: If I don't power the target and let the PICkit 2 power it, I can connect normally, but I can't program the chip. It makes like it's programming but doesn't verify correctly because it hasn't been programmed. The old program is still there and running. When I turn on target power again and try to connect, it won't.

I've tried erasing the chip. It goes through the motions but doesn't erase.

This afternoon I'm going to plug in my Inchworm+/Unicorn and see what transpires. :p
 
Last edited:

futz

Active Member
It appears to be some kind of power thing.

With the Inchworm+/Unicorn I still can't connect with the target powered. But if I turn off target power and let the Inchworm+/Unicorn power it (LCD is dim - borderline not enough power) it works perfect.

But I've used these HVWTech power supplies for a long time and they've always worked flawlessly, so I don't know what's going on. I swapped to another and nothing changes. I measured and it's putting out exactly 5.08 volts.

Switched back to Junebug and same thing. Whenever target is powered it can't read device ID and won't connect. Switch it off and the Junebug connects normally, but won't program because it can't supply enough power.
 
Last edited:

mvs sarma

Well-Known Member
Futz,
which version driver you are using ? is it V2.5? can you make a try with a lower version and let us see?

link to your power supply is broken i fear. How ever, on the target board you may use 0.1uF MLC cap only across pins 5 and 14, and for a while avoid additional electrolytic caps.

Ps: the link has additional http ( twice) . Now i get it.
 
Last edited:

blueroomelectronics

Well-Known Member
With the Inchworm+ / Unicorn combo try plugging in a wall adapter to the Inchworms power connector. USB power is way too weedy for some applications.
 

futz

Active Member
which version driver you are using ? is it V2.5? can you make a try with a lower version and let us see?
Is this what you're looking for? PICkit 2 OS : 2.20.0 is what it downloads when I tell it to Download OS.

link to your power supply is broken i fear.
Oops! Here it is again.

How ever, on the target board you may use 0.1uF MLC cap only across pins 5 and 14, and for a while avoid additional electrolytic caps.
I usually don't put any caps on the breadboard at all, since the power supply is already filtered.
 

blueroomelectronics

Well-Known Member
PS make sure you set the Inchworms VDD +5V power jumper to ON, it's diode blocked from your computers USB and will supply your project with over 500ma. If you leave the jumper off the BS250 can only handle 230ma.
 

mvs sarma

Well-Known Member
Is this what you're looking for? PICkit 2 OS : 2.20.0 is what it downloads when I tell it to Download OS.


Oops! Here it is again.


I usually don't put any caps on the breadboard at all, since the power supply is already filtered.
Nice
As you rightly said, it had worked well under the same circumstances earlier.
this made me feel whether a SW change took place in between? OK now i understand that you use V2.2

Please add a cap of say 0.1 (100nF)across pins 5 and 14 (18pin devices)
even if there are caps on the power board.
 

futz

Active Member
PS make sure you set the Inchworms VDD +5V power jumper to ON, it's diode blocked from your computers USB and will supply your project with over 500ma. If you leave the jumper off the BS250 can only handle 230ma.
There's no jumper on this Inchworm+. There is a switch though - EX 5V On/Off.

With the Inchworm+/Unicorn:
Target power on - connects sometimes - programs sometimes
Target power off (Inchworm USB power) - connects - programs
Target power off (Inchworm wall wart power) - connects sometimes - won't program

The PICkit 2/Junebugs do similar strangeness. The odd thing about all this is that I made no changes to the circuit. It worked fine. Then it didn't.

I have to go to work now. Will continue messing with this probably this afternoon or evening.
 
Here's a long shot idea. Sometimes I have run into a problem when the task manager gets loaded up with a bunch of .exe files that are left hanging. That causes XP to run out of memory, and either clearing out the offending .exe files in task manager, or rebooting is required.

Really sounds like some sort of hardware problem tho, almost like the MCLR pin is acting up for some reason. Maybe try the hardware diagnostic tool and check the voltages, signal frequency, etc.
 

futz

Active Member
Here's a long shot idea. Sometimes I have run into a problem when the task manager gets loaded up with a bunch of .exe files that are left hanging. That causes XP to run out of memory, and either clearing out the offending .exe files in task manager, or rebooting is required.
I don't think that's it. My shutting down and rebooting would have fixed it, and anyway this machine has 2GB of RAM so it would take a LOT of programs running in background to crap it out.

Really sounds like some sort of hardware problem tho, almost like the MCLR pin is acting up for some reason. Maybe try the hardware diagnostic tool and check the voltages, signal frequency, etc.
Yes it does, but so far I'm at a loss to explain it. Will try some more things this afternoon to see if I can pin it down to something specific.
 

futz

Active Member
Here's another hint: I've noticed that the programmer will almost always connect the first time. But every attempt after that fails with PKWarn0003: Unexpected device ID: Please very that a PIC16F88 is correctly installed in the application. (Expected ID = 0x760, ID Read = 0x0)
 
You did run the Pickit 2 ->Tools->Troubleshoot right?

My settings for Programmer-> verify on write
Tools->fast programming
Target VDD Source->auto detect

I can hang the Pickit 2 by trying to program an 18f when there is a 16f in the socket, and vice versa. Usually hitting the Tools->check communication will put it back on track, barring that, closing and restarting does the trick.

You don't have the Program->manual select device ticked? (i.e. wrong device selected). That would fit the situation you describe.
 

futz

Active Member
You did run the Pickit 2 ->Tools->Troubleshoot right?
I hadn't done that. Just did it and it passed every test perfectly. My new multimeter even has Hz measurement, so I could confirm the 30kHz thing.

When I started up the software and did a comm check, it did just what was happening before - with target power on, the chip was not detected. With target power off, it was.

While tinkering with the PICkit software I did a full erase of the chip. I also looked at every other available thing in there just in case there was something that would fix my problem.

I shut that off and went back to MPLAB and now it works fine! Maybe the erase fixed it? I don't know exactly what cured it, but it seems good now... Wonder what all that was about? Weird.

EDIT: False alarm. It's still screwed up. :D
 
Last edited:

futz

Active Member
OK, it's my program. Must have made a change to the config bits, though I don't remember doing so. I don't see anything wrong with them, but I erase the chip with the PICkit software and can then detect the chip both with and without target power.

But after reprogramming the chip with my program I can't detect the chip with target power on, but CAN detect it with target power off.

Here's my program's config line:
Code:
#pragma DATA _CONFIG, _WDT_OFF & _INTRC_IO & _LVP_OFF & _MCLR_ON
 
Last edited:

futz

Active Member
And I narrowed it further. It wasn't config bits. I had been messing with Timer1. I had previously set it to expect a clock source on the PGD/PGC pins (I knew it couldn't be programmed with the crystal plugged in, and it had been removed), but I was sure I had disabled that. Guess I was mistaken, because when I comment all Timer1 code out, I can program the PIC and everything still works.
 

futz

Active Member
Well that was a good (but horribly time consuming) lesson. The details are on my site if you want to see.

Who'd of thunk that once you set Timer1 to use a crystal you can't reprogram the chip without erasing it first. And you can't erase it with MPLAB. Weird! :p

EDIT: My 1000th post!
 
Last edited:

Pommie

Well-Known Member
Most Helpful Member
This came up a while ago. A poster thought his code somehow broke the 88 and it turned out he was enabling the timer1 crystal. One to keep in mind. I found a similar thread but the consensus was that this couldn't happen.:rolleyes: clicky

Mike.
 
Status
Not open for further replies.

Latest threads

EE World Online Articles

Loading
Top