2021-09-05 01:08 AM
I am using STM8S003F3.
Currently my application requires sampling two ADC channels, which are interfaced with:
1) Output of a resistor divider network which is routed directly to the microcontroller's ADC CH 3
2) Analog output of a sensor module PCB connected to the microcontroller PCB module via connector to the ADC CH 4.
Initially, I was using SINGLE CONVERSION MODE to scan the channels, by initializing the ADC with the next channel number each time, one after the other, after scanning a particular channel.
In this scenario, when sensor PCB was disconnected, there was no floating voltage observed on the ADC CH 4, as a result the logic seemed to work fine.
Later, I switched to SINGLE SCAN MODE, when I thought it was a much efficient way to scan multiple channels. I was able to get correct ADC values from the data buffer.
However, in this case, when sensor PCB was disconnected, a floating voltage around 1V- 2V was observed on the ADC CH 4, which impacted the application's function.
I do not wish to make changes in the microcontroller PCB module, since it is already manufactured. Is there a way to tackle this floating voltage on analog pin via software, so that there is 0 V, when the sensor is not connected, without having to add a pull down resistor from the ADC pin?
And why did this occur after using the SCAN MODE and not during the SINGLE CONVERSION MODE?
Any input will be of great help.