mirror of
https://github.com/Telecominfraproject/OpenCellular.git
synced 2025-12-27 18:25:05 +00:00
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 <victoryang@chromium.org> Reviewed-on: https://gerrit.chromium.org/gerrit/42845 Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user