Problem with programming 18f26J53

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I am getting a strange issue programming a 18f26J53.

I get the following error:

upload_2015-11-27_17-44-54.png

I scoped out the I noticed that if I ground my scoped out the PGC And PGD pins to see if I can see transitions from the PicKit3. When I hold the probe on PGC the chip programs and runs. It continues to run after the probe is removed.

The chip is in a PCB which I designed. I checked solder joints etc. I thought maybe the pressure was actually fixing the issue (bad socket etc) so I just pressed on the chip in about the same place as I put the probe but it did not help. Also the probe must be grounded for it to program.

Attached is my schematic. Any ideas?

I have those jumpers on PGC and PGD. Not sure if I really needed them to repupose and output pins when the code is up and running non debug.
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
See if the ground of your programmer is connected.

That is the only connection your scope could be making for you.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
Pretty sure it is. I think the issue might be those jumpers. They are those little blue jumpers. I swapped them out a couple of times but same issue. I suppose I could have a bad batch that are corroded inside. And this does seem to be an intermittent issue.

If I use a test clip a to make the connection on the PGC header pins on the board then it works. What I can't figure out is how the scope probe/ ground fixes the issue. Very strange.

Am I being overly concerned with those outputs? Do I even need the jumpers? Once I get this up and running I plan to use those 2 pins as outputs for LEDs. If LEDs are connected to those pins (and I didn't incorporate the jumpers into the design), will the LEDs being on those pins affect operation of PGC and PGD? Basiclly what I am thinking is can I safely permanently connect those header pins?
 

ErnieM

Joined Apr 24, 2011
8,377
A "Target Device ID" of 0x0 (zero in hex!) indicated no data is being returned thru the programming interface. The clock or the data line, or both, are bad.

Perhaps if you swap out the blue jumpers for red jumpers things will improve. Everyone knows blue jumpers are bad luck.
 

nerdegutta

Joined Dec 15, 2009
2,684
I recon J1 is the ICSP header. Shouldn't VDD be connected to some power rail or +3.3v or 5v?

I have two PICKit3 and when I breadboard circuits, MCLR is always connected to +5vdc, with a 10K resistor. Where is the powersource?

Just a thought. :)
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I recon J1 is the ICSP header. Shouldn't VDD be connected to some power rail or +3.3v or 5v?

I have two PICKit3 and when I breadboard circuits, MCLR is always connected to +5vdc, with a 10K resistor. Where is the powersource?

Just a thought. :)
That is not the issue. I caught that error in my schematic. Of course after I built the PCB. ;) I fixed it with a jumper wire. Yes I really should have corrected it in the schematic after posting. But good catch!
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I have still not solved this issue and it is very frustrating.


I discovered I have a similar issue to Russell.

http://forum.allaboutcircuits.com/threads/pic-16f873-nrf24l01-power-problem-body-capacitance.118087/

I have discovered that if I place my finger across the 14-28 pins on the bottom side of the board I can get the pic to program. I suspect I am introducing capacitance into the circuit.
Russell solved his issue by adding a cap and resistor on mclr. I already have a pullup on mclr. I have not added a cap to mclr but I am skeptical it will solve the problem because I don't need to touch mclr to get the pic to program just pgc and pgd. Before adding the cap I figured I would check here firsts.

I have gone over the solder joints and reseated the chip in it's socket and still no dice.

Any ideas? Should I add that cap? Never had to before. Chip programs fine out of circuit.


May schematic is posted above. I am including the pcb layout here in case that might be an issue.
 

Attachments

ErnieM

Joined Apr 24, 2011
8,377
Hi, I popped years ago in simulair problem.

Pin 6 corcap needs 10uF +100nF to gnd.
That is in complete agreement with the data sheet sec 2.4, and if it doesn't solve this problem it will solve the one you haven't had yet.

As far as putting LEDs on the programming lines that is probably a bad thing, bu worth the experiment to try. I will buy a larger device so I can leave these pins 100% free and clear. That means I can always stick a debugger on my final hardware.

I have seen cases where I could not program a device with a large (10 uf plus) cap on VCC, but I believe that was using the PM3 programmer; PICkits are more tolerant of caps.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
I have jumpers for the data lines while programming and debugging. Not at home right now but I don't think I have anything connected on pin 6. Do I need anything else other than the caps? It did work out of circuit with no caps on that pin. And I don't need to touch pin 6 to get it to work.
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
No caps for the supply. I am using a bench supply. Well maybe the supply has caps but nothing I added. Will be coin cell when this is done.
 

ErnieM

Joined Apr 24, 2011
8,377
No caps for the supply. I am using a bench supply. Well maybe the supply has caps but nothing I added. Will be coin cell when this is done.
There's a sticky up top about using bypass caps. If you read it you will notice there is no such disclaimer as "not necessary a long as you use either a bench supply or a battery."
 

Thread Starter

spinnaker

Joined Oct 29, 2009
7,830
There's a sticky up top about using bypass caps. If you read it you will notice there is no such disclaimer as "not necessary a long as you use either a bench supply or a battery."
I do have my bypass cap. :) I mean no other larger caps like a 10uf.
 
Top