Associate II
July 14, 2021
Question
STM32L031, VREFINT error depending on prior channel voltage.
- July 14, 2021
- 3 replies
- 1057 views
I am using a STM32L031 on a Nucleo board to sample analog inputs and VREFINT. When I sample the VREFINT voltage after another channel I observe some error that changes depending on the voltage on that previous channel. I assuming that charge is being carried from the previous sample to the VREFINT channel. I could not find this issue discussed in documentation. A long delay between the sampling helps but it is undesirable due to energy usage. How can I eliminate this issue.
A second issue is the code only works correctly when I sample channels in order. If I instead sample 5, 3, 4, VREFINT the data is incorrect. What am I missing?
I attached the code.
