AnsweredAssumed Answered

STM32F030R8 NUCLEO - ADC ERROR VALUE - VALUE LESS THAN EXPECTED

Question asked by santos.pedro.004 on Nov 6, 2016
Latest reply on Nov 6, 2016 by Clive One
Hi, 

I have the board nucleo STM32f03R8 and my analog signals are less than that expected value. I use the CubeMx to configure ADC, I selected it as in this tutorial (http://letanphuc.net/2016/07/stm32f0-adc/) but my board with low signals in analog input show value (0-4095) with error.

example: 1.311V ->  1567 read the value expected is 1626
example: 2.363V ->  2866 read the value expected is 2928

The code of ADC configure is:

hadc.Instance = ADC1;
  hadc.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV1;
  hadc.Init.Resolution = ADC_RESOLUTION_12B;
  hadc.Init.DataAlign = ADC_DATAALIGN_RIGHT;
  hadc.Init.ScanConvMode = ADC_SCAN_DIRECTION_FORWARD;
  hadc.Init.EOCSelection = ADC_EOC_SINGLE_CONV;
  hadc.Init.LowPowerAutoWait = DISABLE;
  hadc.Init.LowPowerAutoPowerOff = DISABLE;
  hadc.Init.ContinuousConvMode = DISABLE;
  hadc.Init.DiscontinuousConvMode = DISABLE;
  hadc.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_NONE;
  hadc.Init.DMAContinuousRequests = DISABLE;
  hadc.Init.Overrun = ADC_OVR_DATA_PRESERVED;
  HAL_ADC_Init(&hadc);

Sorry for my english. Thanks 

 

Outcomes