How can I detect an open analog input pin?
Solution (in case you were wondering...)

The image below shows a sample circuit used in the application.  Vdd is an unregulated source that's considerably higher than what the micro expects to see.  Vcc is a regulated source that is also the source voltage for the A2D engine in the micro.  The sensor is a resistive device.



The fault that was being induced in the circuit that the software was expected to find was the removal of the resistor shown in red.  The reason the precharging didn't work is that the external capacitor was large enough to prevent the A2D sampling capacitor from charging sufficiently; its maximum charge time is 15 clock cycles and the clock is 50 MHz (300 nsec.)

The code was modified to perform a "precharge" manually.  To test if the analog input pin is open, the pin was reconfigured as a digital output, driven high, then reconfigured as an analog input and read after a very short delay.  This A2D value could be used to determine if the red resistor was present or absent.