I have jerry rigged a PIC programmer but I need to use the PGC/PGD pins as part of the actual circuit. I'd like to be able to flash the PIC without physically swapping it between the circuit and the programmer. Will this do the job?
CTL_ON,CTL_OFF (from the programmer) will be either 0,1 or 1,0 (never 1,1). CTRL_ON,CTRL_OFF will only change when the PIC is powered down. CTL_ON will only be 1 when RB4/PGM is high (i.e. PIC is being flashed). These rules will be handled in the programmer firmware.
Do I need resistors on the lines going into the T3 and T1 collectors? If so, can anyone explain why? I've spent a lot of time looking at web pages about this stuff, but can't quite seem to grasp the fundamentals. Pointers to any tutorials for beginners would be welcomed.
Note that this is not about isolating the power supply, that's already taken care of.
In this partial schematic, the RB7/PGD pin is just powering an LED for example, and can only be used as an output (when CTL_ON,CTL_OFF = 0,1), which is fine.
OK, so I guess I need a kind of switch which can be controlled by a separate signal from the programming device, like in the drawing below. Can anyone tell me how to implement such a thing? It needs to allow flow in both directions... Kind of like a relay, but for logic signals.
I think a bilateral switch is what I need, like this one:
Right? Or is there a simpler way just using resistors, diodes and transistors?