ICSP design problem on PIC16F628A

icspmicrocontrollerpicprogramming

I just added the ICSP port on this schematic here

enter image description here

however, when the programmer powers the circuit from the ICSP (pin1 +5V, pin6 GND) it also polarizes the relay and the bs170. If for some reason the BS170 triggers the relay will start to draw a lot of current straight from the programmer (pickit2, 3 or whatever). Is it a concern? I'd like to avoid a physical switch to isolate the relay from the circuit when in programming mode.

Best Answer

If you try to pull more current from the ICSP than it's rated to supply, you could damage the ICSP, or trip the breaker in the USB hub (if you have a decent hub with proper breakers).

It's reasonable to assume that an NPN transistor will not turn on spontaneously. It can turn on from the I/O pin. If you wish to be extra safe, you can add a fuse to the +5V line in the ICSP cable.

Few more comments on your schematic.

  • Did you deliberately not add a 47kΩ pull-up between MCLR# and +5V ?
  • Schottky would be a better diode for back EMF protection of the relay.