cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F030R8 NUCLEO - ADC ERROR VALUE - VALUE LESS THAN EXPECTED

geral
Associate
Posted on November 06, 2016 at 22:37

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 

 

#adc-error-vref-stm32f0-vrefint
1 REPLY 1
Posted on November 06, 2016 at 22:52

What is my problem? Please Help me 

 

 

Tank you people...  

 

You should perhaps reflect on the value reported for VREFINT, and that on the VREF+ pin. VREF+ on the DISCO is 3.0V, I think it is 3.3V on the NUCLEO, but you should check with a meter, it will impact the computation of the voltage vs the measurement.

China Tanks it's people

0690X000006033cQAA.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..