Need help reading BOTH temperature and reference voltage
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-19 4:17 PM
Posted on May 20, 2016 at 01:17
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
Labels:
- Labels:
-
STM32Cube MCU Packages
This discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-19 4:31 PM
Posted on May 20, 2016 at 01:31
Or do I need to actually set up a DMA operation with a 2-field buffer.
On most STM32 that's usually the procedure.
Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2016-05-20 2:11 AM
Posted on May 20, 2016 at 11:11
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-