2023-08-03 04:30 AM
Hello All,
Just some context on what I'm trying to achieve. I have a board which has 4 NTCs creating a potential divider which is then sampled by the ADC. The supply to this potential divider is from one of the IO pins of the STM32F030 (SENSOR_3v3). The schematic is shown below
As the output from the IO pin may well not be exactly the same as VDD to the MCU I am currently trying the following out.
The SENSOR_3v3 is on an IO pin which can also be one of the analog channels. So I have told the MCU to sample that pin whilst the GPIO setup for that pin is to be a push pull digital ouput. This gives me the analog reading of the SENSOR_3v3 whilst it is supplying power to the NTCs which i can then use to scale the analog correctly.
My question is will this cause damage internally to the MCU. As far as i can tell the internal analog sampling is behind a fairly significant resistor so there should be no problem, am I correct on this?
Solved! Go to Solution.
2023-08-03 04:40 AM - edited 2023-08-03 04:50 AM
There are no issues with this scheme. Analog circuitry is still connected in output mode and the output is certainly within the allowable range of the ADC.
Edit: To give you a sense of how much this actually affects things, I hooked up an output to a 22 kΩ resistor to ground. VDD = 3.295 V, the pin measured 3.289 V. 0.2% off. This was on an F4.
2023-08-03 04:40 AM - edited 2023-08-03 04:50 AM
There are no issues with this scheme. Analog circuitry is still connected in output mode and the output is certainly within the allowable range of the ADC.
Edit: To give you a sense of how much this actually affects things, I hooked up an output to a 22 kΩ resistor to ground. VDD = 3.295 V, the pin measured 3.289 V. 0.2% off. This was on an F4.
2023-08-03 05:48 AM
Thank you for that. Thats good to know.
2023-08-03 06:30 AM
Be advised, that sensor with bias circuitry has quite high output inpedance, and ADC likely have noise and offset when sampling. Try to add a capacitor 0.1uF in between A_TEMPx and ground and check what improvment it provides