PICkit2 affecting GPIO.0 voltage

Thread Starter

tracecom

Joined Apr 16, 2010
3,944
In the attached schematic, I want a .850V reference on GPIO.0, which I get when the PICkit2 is plugged in. But when I unplug the PICkit2, the voltage jumps to 1.182V. Why? What have I done wrong?
 

Attachments

tshuck

Joined Oct 18, 2012
3,534
You have made a voltage divider: V out = V in * R3/(R3 +R4)...so 1.176 ~= 1.182 is what is expected...

The pickit may very well have been loading the divider....

You should use a voltage reference instead of a coupe resistors...
 

Thread Starter

tracecom

Joined Apr 16, 2010
3,944
You have made a voltage divider: V out = V in * R3/(R3 +R4)...so 1.176 ~= 1.182 is what is expected...

The pickit may very well have been loading the divider....
You are correct on both counts, but why does the PICkit2 load the divider? Vcc is unchanged. ETA: This is a superfluous question; just ignore it. I learned something useful today; watch out for loading during in-circuit programming.

The fixed resistors will be replaced with a pot so that I can adjust the reference voltage. I was under the impression that such an arrangement was acceptable practice; is it not?
 
Last edited:

tshuck

Joined Oct 18, 2012
3,534
Resistors are much more susceptible to thermal influences than, say, a voltage referenc IC. How susceptible they are can vary even among types of resistors: e.g. wire-wound vs. carbon filament resistors.

The pickit should be isolated from the circuit, look at the datasheet for your PIC, they will usually have a typical circuit for isolation in it.
 

Markd77

Joined Sep 7, 2009
2,806
I try to avoid anything on programming pins if I can, but with the smaller PICs it can be impossible. Sometimes I use a 4 way DIP switch on the breadboard to isolate power, MCLR, data and clock and plug in the PICKIT only for programming. I find that an LED with a 1K resistor is usually OK on clock or data, but with any more load than that, there is likely to be programming difficulties. Sometimes I will solder a PIC in place in the final circuit, knowing that to reprogram it I'm going to have to break tracks to isolate it.
 

upand_at_them

Joined May 15, 2010
940
It's likely that the PICKIT pin that connects to GPIO.0 (ICSPDAT) doesn't go to full high impedance. The PICKIT pin impedance winds up in parallel to R3, so anything other than a really high impedance causes an effective lower value for R3. And that's what you're seeing.

I think AVR users have the same issue with the STK500.

You could isolate the PICKIT with a relay, triggered by MCLR. One example of it is at the top of here: http://www.electricstuff.co.uk/picavrstuff.html
 
Top