cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F7 HAL ADC Failes to select TEMPSENSOR

jorgen
Associate
Posted on January 14, 2016 at 11:06

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.

#adc-vbat-tempsensor-hal
0 REPLIES 0