PDA

View Full Version : Using ICSP and a diode



Christopher4187
- 13th January 2009, 14:05
Hi,

I typically use a 10K resistor and a diode in series to the MCLR when using ICSP. I have read through this thread:

http://www.picbasic.co.uk/forum/showthread.php?t=516

What I would like to know is if anyone has sucessfully (without damaging anything) used just a 10K resistor to program using ICSP? If I must use a diode, I will, but I'm trying to use the least amount of components as possible

Having said that, is it possible to temporarily connect the diode and resistor for programming and then remove them after the programming is completed? In other words, when there is 0 volts on the MCLR pin, will the PIC run with no problems after you finished programming it??

Thanks,

Chris

Melanie
- 13th January 2009, 14:45
Well two questions spring to mind... answer those and you have your answer...

1. How is my PIC handling MCLR? Internally or Externally?

2. If I have anything connected to the MCLR pin externally, am I likely to blow it up by applying a high programming voltage to it? Usually folks have +5v connected to MCLR, applying 13v or more risks having that high voltage being distributed around your board to components that normally are expecting 5v (and runs the risk that your programmer is now powering-up your whole board). In the words of Clint Eastwood as Dirty Harry... "Do you feel lucky?".

Christopher4187
- 13th January 2009, 14:57
Thanks for the reply. I do lack the experience that most people posses here on this forum, however, I think I should be able to answer both of your questions.

1. How is my PIC handling MCLR? Internally or Externally?

I believe it's external because in my code I have "MCLR_OFF" and the only thing connected to RA3 (16F688) is the pin from the ICSP plug.

2. If I have anything connected to the MCLR pin externally, am I likely to blow it up by applying a high programming voltage to it?

As I answered above, nothing else is connected to MCLR. On the schematic, it goes +5V.....diode.....10K......RA3 (MCLR).

So, if I'm assuming correctly, which almost never happens :-), the answer is yes that I can use just a 10K resistor to program. If that's true, what happens if the MCLR is left disconnected (no voltage) when the program is running? Will there be no effect in operation?

Thanks,

Chris

Melanie
- 13th January 2009, 15:24
With MCLR-OFF then the PIC is handling MCLR internally and you have I/O capability on that pin. But, if you are not using that pin for any I/O purpose, then there is no need to have anything connected to it. If you have nothing else connected to it then there is no risk of your Programming Voltage affecting any other circuitry. If you do have something connected to that pin, then you need to protect whatever it is from the Programming voltage (purpose of the Diode).

Christopher4187
- 13th January 2009, 15:45
Great. Last question, I promise! If I am only using that pin for MCLR, do I even need a resistor? Can I just program with a trace running from the ICSP to RA3 or will that damage the PIC for some reason?

Charles Linquis
- 13th January 2009, 16:49
You need a resistor from MCLR to Vcc to hold it high in normal use - this has nothing to do with the programming function.

Jerson
- 13th January 2009, 17:02
You need not use any resistor or diode on the MCLR line from the ICSP connector On the other hand, your should make sure that the ICSP connector does not power up your entire circuit as it may end up loading the programmer supply!!