Electronic – PIC/ICSP – Protect circuit from VPP voltage

icsppic

I'm more of a software engineer, but I've done a fair amount of toying with components and microcontrollers. That said, this has me concerned, and my searches so far seem to indicate that no one's ever had an issue with this.

I have a PIC12F675 – it has 6 I/O pins, and I need all of them. One will be an analog input, the rest LED outputs. And since I'll likely be soldering this to the board, I think the potential for ICSP would be of great use, to add features or fix bugs later. The only problem, as I have recently discovered, is that the VPP is something around 13 volts. On a pin that's connected to an LED. I'm not much of an electrical engineer, but I'm thinking the 220-ohm resistor isn't going to stop things from exploding.

What can I use to protect the LED, or other circuitry in general? I've got several of these chips, so I'm sure the issue will come up again, with components of varying sensitivity.

Best Answer

schematic

simulate this circuit – Schematic created using CircuitLab

D2 can be any old PN diode, or Shottky. It will not conduct when Vpp goes above Vcc plus a diode drop, other than the spec'd reverse leakage current. That will probably be \$<10\mu A\$ depending on your diode choice. You'll turn the LED on by pulling Vpp low. Since you're adding another diode drop, R1 will need to be resized to allow the desired current to flow. Make sure you keep your LED currents within the device's absolute maximums.