2016-06-22 09:29 AM
It is recommended to use DMA for multiple ADC channels, and I spent too much time trying to switch between channels manually.
So I used STM32CubeMX to get DMA working for ADC1_Channel_0 and Channe_1 It seems with 3V3 for VDDA, I read a max of 4033 out of 4096 for 12 bit ADC. I know 3V6 is the VDDA MAX for the ADC. 1) How do I calculate what the ADC value should be, for a certain input voltage. I need to have a number od set points, but to practically measure them is time consuming. 2) What is the actual Voltage that will cause a ADC value of 4095 (I know I can practically measure it) Any help appreciated2016-06-22 09:48 AM
For a 3.3V VREF (VDDA)
millivolts = (3300 * sample) / 4096;Where 4095 would get you 3299, some people use a 4095 divisor but I don't think it makes much difference, and the math is more efficient with 4096.