From f84a5fa8b1f6d688c73a1e6e9b33df79489cbfef Mon Sep 17 00:00:00 2001 From: Vic Yang Date: Thu, 7 Feb 2013 10:53:59 +0800 Subject: [PATCH] stm32: Lengthen ADC sample time Current sample time 1.75us seems too short and some nets with weaker driver don't convert correctly. Let's lengthen it to 8.75us. BUG=chrome-os-partner:14319 TEST=See correct voltage level. BRANCH=none Change-Id: Ib65a07474787504e5f72522167bafad8bb5730bc Signed-off-by: Vic Yang Reviewed-on: https://gerrit.chromium.org/gerrit/42845 Reviewed-by: Vincent Palatin --- chip/stm32/adc.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/chip/stm32/adc.c b/chip/stm32/adc.c index c91a5148cb..835f700e23 100644 --- a/chip/stm32/adc.c +++ b/chip/stm32/adc.c @@ -169,11 +169,11 @@ static void adc_init(void) STM32_ADC_CR2 &= ~(1 << 11); /* - * Set sample time of all channels to 1.5 cycles. - * Conversion takes 1.75 us. + * Set sample time of all channels to 7.5 cycles. + * Conversion takes 8.75 us. */ - STM32_ADC_SMPR1 = 0; - STM32_ADC_SMPR2 = 0; + STM32_ADC_SMPR1 = 0x00249249; + STM32_ADC_SMPR2 = 0x09249249; } DECLARE_HOOK(HOOK_INIT, adc_init, HOOK_PRIO_DEFAULT);