cancel
Showing results for 
Search instead for 
Did you mean: 

STM32L073 adc polling async clock ?

stress
Associate

hello, i am using the STM32L073 for adc reading.

And want to use the async clocks for the dc voltage reading. so i dont need a high speed clock.

The problem is when i tested the async clocks on adc , the measurement time was sometimes(30~40%) different from the sampling rate time. but if i used the pclk ,the measurement time is same as the sampling rate time. is it because i used the async clocks?

I am using the HAL library for measuring the adc polling.

HAL_ADCEx_Calibration_Start

HAL_ADC_ConfigChannel

HAL_ADC_PollForConversion

HAL_ADC_GetValue

this is my adc parameter.

  // Configure ADC

  AdcHandle.Init.OversamplingMode   = DISABLE;

  AdcHandle.Init.ClockPrescaler    = ADC_CLOCK_ASYNC_DIV256;

  AdcHandle.Init.Resolution      = ADC_RESOLUTION_12B;

  AdcHandle.Init.SamplingTime     = ADC_SAMPLETIME_239CYCLES_5;

  AdcHandle.Init.ScanConvMode     = ADC_SCAN_DIRECTION_FORWARD;

  AdcHandle.Init.DataAlign       = ADC_DATAALIGN_RIGHT;

  AdcHandle.Init.ContinuousConvMode  = ENABLE;

  AdcHandle.Init.DiscontinuousConvMode = DISABLE;

  AdcHandle.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;

  AdcHandle.Init.ExternalTrigConv   = ADC_EXTERNALTRIGCONV_T6_TRGO;

  AdcHandle.Init.DMAContinuousRequests = DISABLE;

  AdcHandle.Init.EOCSelection     = ADC_EOC_SINGLE_CONV;

  AdcHandle.Init.Overrun        = ADC_OVR_DATA_OVERWRITTEN;

  AdcHandle.Init.LowPowerAutoWait   = DISABLE;

  AdcHandle.Init.LowPowerFrequencyMode = ENABLE;

  AdcHandle.Init.LowPowerAutoPowerOff = DISABLE;

0 REPLIES 0