cancel
Showing results for 
Search instead for 
Did you mean: 

Garbage values while using multiple ADC channels

RJain.1
Associate II

Hi,

I am using STM32H743 Nucleo to interface 9 analog sensors on different ADC channels of ADC1. ADC1 is configured as:

hadc1.Instance = ADC1;

 hadc1.Init.ClockPrescaler = ADC_CLOCK_ASYNC_DIV6;

 hadc1.Init.Resolution = ADC_RESOLUTION_16B;

 hadc1.Init.ScanConvMode = ADC_SCAN_ENABLE;

 hadc1.Init.EOCSelection = ADC_EOC_SEQ_CONV;

 hadc1.Init.LowPowerAutoWait = DISABLE;

 hadc1.Init.ContinuousConvMode = DISABLE;

 hadc1.Init.NbrOfConversion = 9;

 hadc1.Init.DiscontinuousConvMode = ENABLE;

 hadc1.Init.ExternalTrigConv = ADC_EXTERNALTRIG_T1_TRGO;

 hadc1.Init.ExternalTrigConvEdge = ADC_EXTERNALTRIGCONVEDGE_RISING;

 hadc1.Init.ConversionDataManagement = ADC_CONVERSIONDATA_DMA_CIRCULAR;

 hadc1.Init.Overrun = ADC_OVR_DATA_PRESERVED;

 hadc1.Init.LeftBitShift = ADC_LEFTBITSHIFT_NONE;

 hadc1.Init.OversamplingMode = DISABLE;

uint16_t adc_op[9];

In Main:

 if (HAL_ADC_Start_DMA(&hadc1,(uint32_t *)adc_op, sizeof(adc_op) ) != HAL_OK)

 {

 Error_Handler();

 }

 if (HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1) != HAL_OK){

 Error_Handler();

 }

When I am connecting a sensor on Channel 10, some garbage data is reflected on other channels too.

I am unable to debug the problem.\

Please help.

Thanks,

1 REPLY 1
FBL
ST Employee

Hello @RJain.1​,

To identify the source of interference, disconnect sensors. Then, you can proceed by adding and testing sensors one by one.

According to AN2834, you may need to check section 3.2 Errors due to the ADC environment for better details about the root cause.

You can find out as well how to reduce their effects.

Hope this helps!

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.


I'm out of offce with limited access to my emails.
Happy New Year!