cancel
Showing results for 
Search instead for 
Did you mean: 

Using Temperature Sensor and VREFINT in STSPIN32G4 MCSDK

1123
Associate II

Hi , all

I am currently working on a project using the STSPIN32G4 together with the STM32 Motor Control SDK (MCSDK). I would like to add the internal Temperature Sensor to monitor the MCU temperature.

In STM32CubeMX, I have already enabled both the Temperature Sensor and VREFINT channels on ADC1, and generated the initialization code. Then, I configured the Temperature Sensor and VREFINT using the RDivider_Handle_t structure, and used the related APIs to read the ADC values.

However, no matter whether I read the Temperature Sensor or VREFINT, the ADC values are always very close to zero, as if the sampling is not working correctly or is misconfigured.

My questions are:

  1. Within the MCSDK framework, is it possible to directly use RDivider_Handle_t to read the Temperature Sensor and VREFINT channels?

  2. If not, what is the correct way to configure and acquire the ADC raw values for these internal channels?

  3. Are there any additional calibrations or specific initialization procedures required?

1751018398428.jpg

1751018547608.jpg

  

Thank you!

0 REPLIES 0