Automatic ICSP Disconnection

Tips, Tricks and methods for programming, learn ways of making your programming life easier, and share your knowledge with others.

Moderators: Benj, Mods

Post Reply
User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Automatic ICSP Disconnection

Post by acestu »

Hi,

I thought some of you may find this info interesting, it is a pdf document that shows you how to connect and disconnect your ICSP header automatically using a quad bi-lateral switch...
ICSP_Switch.pdf
(485.15 KiB) Downloaded 398 times
cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Automatic ICSP Disconnection

Post by acestu »

Hi,

I don't know if anybody has looked into this yet but I have a few questions if anyone can answer them please:

I would be connecting a pickit3 programmer and the connections are: 1. MCLR/VPP 2. VDD Target 3. VSS Ground 4. PGD 5. PGC 6. PGM/LVP

1. What are the TXD,RTS,DTR,CTS pins ?

2. Why is the VDD of the 4066 connected between the bridge rectifier and the regulator ?
icspauto.JPG
icspauto.JPG (66.36 KiB) Viewed 9010 times
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Kenrix2
Flowcode v5 User
Posts: 211
Joined: Tue Feb 19, 2013 9:51 pm
Has thanked: 72 times
Been thanked: 177 times
Contact:

Re: Automatic ICSP Disconnection

Post by Kenrix2 »

1. They are the serial port pins on a PC.
2. To provide the high voltage required for programming.
If you already have a PICkit3 I am not clear why you would want to build this unit? What software does it use? It is a very simple design though, quite clever.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Automatic ICSP Disconnection

Post by medelec35 »

I agree with Kenrix2 if using PICkit3 you will not require the bridge, 4066 etc.
This is because the programmer circuit was designed around TXD which went negative when not in programming mode whereas with PICkit3 there are no negative voltages when not in programming mode.
What I do for ICSP is directly connect all connections from programmer to target device.
Use 10k resistors for connecting data and clock pins from target device to rest of circuitry e.g pots, switches etc. Will be ok so long as used for either an input or souring high resistance output. So not suitable for driving LED's direct.
Not tried with LCD, in theory should be ok?
Finally I would use a 10k resistor and a diode in series from VDD to MCLR. anode connected to resistor and cathode connected to MCLR.

I have use this method with pots as connected to programming data and clock lines. since analog i/p has high resistance, the 10k resistors had no effect on the analog value.

Martin
Martin

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Automatic ICSP Disconnection

Post by acestu »

Hi Guys,

thanks for the input, I am just trying to clarify how I can use the pickit3 for in circuit programming because I always end up with problems, can I just ask a couple of questions ?

1. Should I use the pickit3 power supply or just the target circuits power supply because when using the pickit3 supply it powers everything in the circuit eg LCD unit.

2. In most of my circuits the PGD and PGC connections are not used in my circuit therefore no need for disconnection from the circuit however do I need to disconnect the MCLR from the rest of the circuit ?

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Automatic ICSP Disconnection

Post by medelec35 »

acestu wrote:1. Should I use the pickit3 power supply or just the target circuits power supply because when using the pickit3 supply it powers everything in the circuit eg LCD unit.
That depends on how much current all the circuitry draws (including microcontroller).
PICkit3 can supply a maximum current of 30mA. so all long as current is limited to below 30mA you will be fine in using PICkit3 for powering your circuit.
If current is going over 30MA then you will have no choice but to use an external supply.
acestu wrote:2. In most of my circuits the PGD and PGC connections are not used in my circuit therefore no need for disconnection from the circuit however do I need to disconnect the MCLR from the rest of the circuit ?

That depends if your using MCLR line for resetting target device or not.
If you are, then you definitely will have to use a form of isolation separating VDD from MCLR because programming voltage going to VPP (MCLR pin) from programmer can be 13V.
13 V and 5V don't mix welll together.
only If you have the option to set MCLR as internal, then you can connect MCLR of programmer directly to MCLR of target device. No isolation components are then necessary.

Martin
Martin

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Automatic ICSP Disconnection

Post by acestu »

Hi Martin,

yes that is what I am struggling with, if you are using MCLR as a reset how do you create a disconnection from target circuitry and connection to the ICSP header ?

This is why I was thinking can I alter and use the cd4066be method somehow, so you can just plug the pickit3 in and program your device...

cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Automatic ICSP Disconnection

Post by medelec35 »

Hi Stuart,
acestu wrote:if you are using MCLR as a reset how do you create a disconnection from target circuitry and connection to the ICSP header ?
Although I did explain in an above post:
medelec35 wrote:Finally I would use a 10k resistor and a diode in series from VDD to MCLR. anode connected to resistor and cathode connected to MCLR
I can create (or find a diagram on the net) to illustrate how its done, you don't require the quad switch.
Martin

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Automatic ICSP Disconnection

Post by acestu »

Hi Martin,

I have tried several searches but not found anything yet, if you have a link that would be great

thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Automatic ICSP Disconnection

Post by medelec35 »

Hi Stuart,
Reading on the forums the diode may not be necessary.
Just connect a 10K resistor from VDD to MCLR.
If using a reset switch connect a normally open switch from MCLR to ground.
If switch is a toggle type, it would be better to connect a 1K resistor in series with the swich to prevent damage to programmer.
programmer can be connected directly to MCLR pin of target device.
Should be no more complex than that.
the 10K resistor will limit the 13V programming voltage to VDD so VDD should not be affected.

Martin
Martin

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Automatic ICSP Disconnection

Post by acestu »

Hi Martin,

I have just found this pic, is this what I am looking for ?

ICSP_isolate.JPG
ICSP_isolate.JPG (36.4 KiB) Viewed 8974 times
thanks
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: Automatic ICSP Disconnection

Post by medelec35 »

Hi Stuart
acestu wrote:I have just found this pic, is this what I am looking for ?
Yes that's exactly what your looking for!
Martin

User avatar
acestu
Posts: 1720
Joined: Thu Dec 01, 2011 9:36 pm
Location: Macclesfield UK
Has thanked: 783 times
Been thanked: 223 times
Contact:

Re: Automatic ICSP Disconnection

Post by acestu »

Ok

Thanks Martin, I will try this in my next circuit.

cheers
Acestu
Laptop Mac Book Pro i7 retina El Capitan //// Tower/Intel i7-Windows 7 64 Bit, Toshiba i5 Laptop Windows 10
Computers are like air conditioners. They work fine until you start opening windows.

Post Reply