Electronic – How to isolate voltage reference from ICSPCLK programmer output

icspmicrochipmicrocontrollerpic

In my application I use PIC16F676 microcontroler with the LM282 (https://www.onsemi.com/pub/Collateral/LM285-D.PDF) external voltage reference (for A/D converter) connected to the RA1 pin. This pin is also used during ICSP (Internal Circuit Serial Programming) as a ICSPCLK clock signal. How can I isolate this voltage reference from ICSPCLK programmer output and succesfully programing the chip?
PIC16F676 with external voltage reference and connected ICSPCLK

Best Answer

I don't think there's a good way to do it. My first suggestion would be to just add a jumper in front of the LM282:

schematic

simulate this circuit – Schematic created using CircuitLab

The jumper (or DIP-switch) should be closed during normal operations and open when programming.

If you absolutely cannot live with this requirement for manual intervention, you may throw in an op amp to avoid that node altogether:

schematic

simulate this circuit

This way your programmer will "fight" against the op-amp, but if the resistance (R2) is high enough, the programmer would "win". During normal operations, the op-amp just buffers the voltage reference. If you go that way, pick an op-amp that accepts inputs and outputs close to the rails - Rail-to-rail I/O.