PIC16F884 ICSP connectivity failure - I'm stumped

Status
Not open for further replies.

Pavius

New Member
A friend of mine is working on a project and is trying to get ICSP connectivity with his boards with no success. I tried myself and simply cannot understand what could be wrong in such a simple board (it's a mounted PCB, not a prototype). Here are the steps i tried:

1) Test my PicKit2 with a 16F886 demo board - works fine
2) Tested continuity of the 5 ICSP pins going to the correct pins on the TQFP PIC16F884, seems fine
3) Connected the PicKit2 to the 5 pin 0.1" male connector directly [as the connector is VPP, VDD, GND, DAT, CLK] - get device id 0 (verified that PicKit2 will source the 5V)
4) I used the PicKit2 diagnostic tools to see that VDD (4.5V), MCLR (12V) and ICSP data and clock are sent correctly from the PicKit2 with a DVM - they're fine
5) Tried 3 other PCBs he gave me with the same basic layout - same
6) I fed a regulated 5V directly to the device, checking they reach both VDD pins and tried with a RealICE - target voltage detected but still device id 0
7) Tried again with PicKit2 - again, target voltage detected but device id is 0

I'm feeling really dumb, but i have no idea what can be the problem. The leads seem to be short (they go through a via), nothing seems to connected to the data/clock pins... Anyone have any direction? See attached schematic clipping.

Thanks
 

Attachments

  • schem.png
    100 KB · Views: 1,389
What is the purpose of the resistor and capacitor on Mclr? The normal thing to have is a diode and resistor from Vdd to Mclr with the anode to Vdd - your diagram has it the opposite way around.

Mike.
 
I pointed that out as a possible issue, but couldn't understand why it should prevent ICSP connectivity. As I understand the diode is there to protect the rest of the circuitry from the 12V. I suggested cutting the lead before R19 (or removing R19) just to isolate it completely but wanted to hear from the forum first before I make any hardware changes.
 
I had similar symptoms on a board I made once.
Is the RB3/AN9/PGM/C12IN2- pin pulled low? (Speciffically the PGM usage of this pin...)

By default low voltage programming mode is enabled until you set the appropriate config words and if this line is floating the chip gets put into low voltage programming mode whether you want it or not, so you need to ensure it is pulled low, at least until you disable LVP in the config words first time you program it.
 
Last edited:
The way the diode in your circuit is orientated it allows the 12V to power Vdd. As I said, it's normally the other way around and without the capacitor. I would remove the 10k, the capacitor and reverse the diode.

Mike.
 
You, sir, are a scholar and a gentleman. I shorted RB3 to GND (it was, indeed, left floating) and everything came alive.

Pommie: Thanks - i will let his hardware guys know. The issue was PGM floating.
 
Last edited:
Here's a curious sub-issue.

Once i hold RB3 to ground, both PicKit2 and MPLAB can access the device with no issues - programming/verifying/debugging. I set the config word so that RB3 is a digital I/O (and not PGM, thus disabling its functionality for LVP) and let it float again. PicKit2 software reads/writes/verifies the device just fine whereas MPLAB can read the device ID, but upon programming gives me:

PK2Error0027: Failed verify (Address = 0x0 - Expected Value 0x2800 - Value Read 0x0)

Any ideas?
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…