2017-02-24 07:22 PM
Hi,
I'm using a STM32F303 (landing page:
http://www.st.com/en/microcontrollers/stm32f303k8.html
) for one of my project. I have PA0 configured as a GPIO output with push pull used to turn ON/OFF a BJT. I also have PA3 configured to use the ADC1 channel 4 module.
When I set PA0 high, the ADC readings increase by about 1.8V. When it is low, the readings are correct. Why does this happen? Externally, these two pins aren't connected directly to each other.
Solved! Go to Solution.
2017-02-25 12:17 AM
Check if the analog supply VSSA/VDDA (if present in chosen package) are well polarized and have decoupling capacitors.
Make sure these supplies are connected somewhere to VSS/VDD
Make sure that all the GPIO which can be connected to ADC/DAC are not used at 5V tolerant IO.
Also make sure the analog input has low impedence.
You could also try instead of push pull ouput high/low to manually select digital input and activate/deactivate the pull-up and pull-down to see its effect on the ADC input pin. Some HW debug seems needed. You might also compare the behaviour with a nucleo/discovery board to make progress in the debug. good luck!
2017-02-25 12:17 AM
Check if the analog supply VSSA/VDDA (if present in chosen package) are well polarized and have decoupling capacitors.
Make sure these supplies are connected somewhere to VSS/VDD
Make sure that all the GPIO which can be connected to ADC/DAC are not used at 5V tolerant IO.
Also make sure the analog input has low impedence.
You could also try instead of push pull ouput high/low to manually select digital input and activate/deactivate the pull-up and pull-down to see its effect on the ADC input pin. Some HW debug seems needed. You might also compare the behaviour with a nucleo/discovery board to make progress in the debug. good luck!
2017-02-25 05:23 PM
Thank you, it seems like the reason is because my VDDA is not within specifications as outlined in the datasheet. I have it as 2.048V at the moment. I've re-uploaded my code onto the nucleo-f303 development board which uses the same chip. It has VDDA as 3.3V, and the readings are measuring fine.