AnsweredAssumed Answered

STM32F7 HAL ADC Failes to select TEMPSENSOR

Question asked by jorgg on Jan 14, 2016
To sample the temperature sensor I am using the HAL_ADCEx_InjectedConfigChannel. Since the ADC_CHANNEL_TEMPSENSOR and ADC_CHANNEL_VBAT share ADC channel, only one of them can be sampled at a time, depending on the bits set in ADC->CCR. The HAL_ADCEx_InjectedConfigChannel seems to set both the VBAT and TSVREF bit which will favour VBAT, thus impossible to sample temperature.

From reference manual (RM0385):
15.11 Battery charge Monitoring
Note:
The VBAT and temperature sensor are connected to the same ADC internal channel (ADC1_IN18). Only one conversion, either temperature sensor or VBAT, must be selected at a time. When both conversion are enabled simultaneously, only the VBAT conversion is performed.

Outcomes