2016-05-19 04:17 PM
Using Cube-generated code...
I'm a little confused about the HAL_ADC functions to read the temperature and reference voltage channels. I can read the temperature with this simple code:HAL_ADC_Start(&hadc);
HAL_ADC_PollForConversion(&hadc, 10);
cpuTemp = HAL_ADC_GetValue(&hadc);
However, it's not clear to me how to read the reference voltage, as well. The same ''hadc'' handle is set up to read both channels. Is it as simple as calling _PollForConversion again? Or do I need to actually set up a DMA operation with a 2-field buffer.
If anybody has some sample code that does this, I'd really appreciate it.
Thanks!
#no-hablo-hal
2016-05-19 04:31 PM
Or do I need to actually set up a DMA operation with a 2-field buffer.
On most STM32 that's usually the procedure.2016-05-20 02:11 AM
Hi seymour.jim,
You can refer to example in HAL library , like ''ADC_RegularConversion_DMA'' in at this path: STM32Cube_FW_F4_V1.11.0\Projects\STM324xG_EVAL\Examples\ADC\ADC_RegularConversion_DMA -Hannibal-