# ADC transient malfunction or ESD failure?

I have a PIC18F46K80 microcontroller. The ADC input is connected with OPAMP TL064I output through a 2.2k resistor and Schottky diodes in the ADC input as in the figure.

I have changed a capacitor C1 in the power supply circuit of this project from 1000uF to 220uF has a voltage of -20V which drives the -12V (VCC-) of the OPAMP.

I have noticed that when the power go OFF while using the 220uF capacitor it discharges faster and the OPAMP output become small but positive (about +300mV) and decay slowly. If the power come back again while this signal (+300mV) is in the OPAMP output (the ADC input); the reading from the ADC gives constant (most of the time is 0) value, despite the signal being 50Hz sinewave.

If I made a software reset or wait for long time before reconnecting the power (until the OPAMP signal become small; less than +200mV, or discharge power supply capacitors by hand), the ADC works properly.

The old design uses a 1000uF in the -20V supply (which discharge slower than the 220uF), and when the power go OFF the OPAMP output goes negative in very short time.

This didn’t occur in every board that I have tested. It occurred in 4 out of 10 boards.

I have assembled these boards in a small SMT assembly factory in Shenzhen. I have noticed that they don’t have a grounded floor and they have only one reflow oven, so they have to put the assembled board in a metal tray to put it by hand in the oven.

I am wondering if this issue is inherit to the ADC operation when transients occur? (Though there are Schottky with resistor!)

Or, could it be ESD damage caused by poor handling in the SMT factory? (other functions by the microcontroller operate correctly!)

As requested in comments, here is the external MCLR circuit:

• What does the PIC reset circuit look like? Dec 18 '17 at 9:58
• It is a software reset I just call a reset_cpu(); function. Dec 18 '17 at 11:09
• Or you want me to look into the datasheet for the circuit inside the PIC? Dec 18 '17 at 11:11
• Or you mean the external MCLR pin circuit? Dec 18 '17 at 11:25
• Yes, the external power-on reset circuit, if any. Dec 18 '17 at 11:40

I think your problem is probably the reset circuit, since resetting the MCU restores operation. If the microcontroller is improperly reset at power-up there is no guarantee of proper operation and the exact effects may vary from unit to unit.

The clamp Schottky diodes allow the op-amp to hold the power up and reducing the negative rail filter cap means that the op-amp output will likely hold the Vdd on the micro above the guaranteed reset zone longer than if the negative rail cap was larger.

If you don't ensure the supply voltage drops below 700mV and rises faster than 50mV/second, the reset is not guaranteed.

It is most reliable to use an external reset IC which guarantees a minimum reset pulse width of perhaps 200ms and properly handles all combinations of short and long interruptions of power or brownouts, but the internal BOR may well work for you if you enable it, particularly at 5V.

As a quick fix, you can hang a resistor of maybe 1K across the Vdd to GND, which will discharge the power supply relatively quickly.

• I will enable the BOR for now. 1K across Vdd to GND will affect the operation of the circuit, power is very limited. I will read more about the reset. Thank you. Dec 18 '17 at 13:58