Skip to content

Commit f8d6f95

Browse files
committed
STM32: F4: Increase ADC sampling time
To get a valid VBAT measurement on F4 targets, it is required to increased the sampling time to its maximum value.
1 parent c826e2f commit f8d6f95

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

targets/TARGET_STM/TARGET_STM32F4/analogin_api.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,9 @@ static inline uint16_t adc_read(analogin_t *obj)
188188
break;
189189
case 18:
190190
sConfig.Channel = ADC_CHANNEL_VBAT;
191+
/* From experiment, VBAT measurement needs max
192+
* sampling time to be avlid */
193+
sConfig.SamplingTime = ADC_SAMPLETIME_480CYCLES;
191194
break;
192195
default:
193196
return 0;

0 commit comments

Comments
 (0)