diff options
author | smark- <ing.smark@yahoo.it> | 2019-03-31 20:32:27 +0200 |
---|---|---|
committer | KevinOConnor <kevin@koconnor.net> | 2019-03-31 14:32:27 -0400 |
commit | eedc773d692e76cb5530fa9184e34fbc1f179eb8 (patch) | |
tree | 67f343c21ce20b81e7d61389af533a48baaf6939 /src/stm32f1/adc.c | |
parent | d1eefba4536055fa99bc872bd2a64c9076407398 (diff) | |
download | kutter-eedc773d692e76cb5530fa9184e34fbc1f179eb8.tar.gz kutter-eedc773d692e76cb5530fa9184e34fbc1f179eb8.tar.xz kutter-eedc773d692e76cb5530fa9184e34fbc1f179eb8.zip |
stm32f1: Fix ADC (#1474)
The sampling time of the ADC was too slow (239 ADC clock cycles), causing the reading of the next ADC channel to have cross talk as per issue #1261. Sampling time updated to 41 ADC clock cycles.
Signed-off-by: Marco D'Alessio <marco@wrecklab.com>
Diffstat (limited to 'src/stm32f1/adc.c')
-rw-r--r-- | src/stm32f1/adc.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stm32f1/adc.c b/src/stm32f1/adc.c index fcdcb911..47271d3e 100644 --- a/src/stm32f1/adc.c +++ b/src/stm32f1/adc.c @@ -76,7 +76,7 @@ gpio_adc_sample(struct gpio_adc g) if (!readb(&adc_busy)) { LL_ADC_REG_SetSequencerRanks(ADC1, LL_ADC_REG_RANK_1, g.bit); LL_ADC_SetChannelSamplingTime(ADC1, g.bit - , LL_ADC_SAMPLINGTIME_239CYCLES_5); + , LL_ADC_SAMPLINGTIME_41CYCLES_5); LL_ADC_REG_StartConversionSWStart(ADC1); adc_busy = true; adc_current_channel = g.bit; |