cancel
Showing results for 
Search instead for 
Did you mean: 

Effect of sampling a Push Pull Digital output using the ADC on an STM32F030

Luke Iliffe
Associate III

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

LukeIliffe_0-1691061709767.png
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?

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".

View solution in original post

3 REPLIES 3
TDK
Guru

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.

If you feel a post has answered your question, please click "Accept as Solution".
Luke Iliffe
Associate III

Thank you for that. Thats good to know.

MasterT
Lead

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