Many of the Renesas micros have built-in support to precharge or discharge the sampling cap on analog inputs to be able to detect when the external circuit is disconnected. In the sample image, when the analog input circuit uses a pullup resistor, you can precharge the cap and if the external circuit is disconnected the input signal will remain high. A similar thing can be done by discharging the cap if the input circuit uses a pulldown resistor. These both assume that the circuit is interrupted at the black "X".

Precharge / Discharge Analog Input

Is there a way to detect when the analog input circuit is interrupted at the red "X"? Is it possible to detect a floating, or open, analog input pin?

If it helps, the port.pin in question can be reconfigured as a digital I/O to do [stuff] and returned to an analog input.

  • \$\begingroup\$ If strictly an analog input, not likely. The S+H cap is too leaky. \$\endgroup\$ Commented Apr 28, 2014 at 23:33
  • \$\begingroup\$ @oosterwal Some microcontrllers (μC) have internal pull-ups. However, why are you so concerned with a μC pin coming off? \$\endgroup\$ Commented Apr 29, 2014 at 4:08
  • \$\begingroup\$ @NickAlexeev It's a regulatory agency requirement. I have to maintain a safe product in case any component in the circuit were to fail--in this case I'm looking for a way to detect if the resistor just outside the analog input pin were to fail OPEN. \$\endgroup\$
    – oosterwal
    Commented Apr 29, 2014 at 11:16
  • \$\begingroup\$ @oosterwal Does the regulatory agency require you to consider only single point failures? Or is it more complicated for you? Is the disconnection of the external circuit a failure, or a part of nominal operation? (By the way, out of curiosity, which agency do you have to satisfy?) \$\endgroup\$ Commented Apr 30, 2014 at 2:10
  • \$\begingroup\$ @NickAlexeev For this application the agencies (UL, IEC, et. al.) only consider single faults. The disconnection is a single fault. \$\endgroup\$
    – oosterwal
    Commented Apr 30, 2014 at 12:12

1 Answer 1


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.

Sample Analog Input Circuit

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.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.