cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F103C6 DMA ADC reads 753 on all 8 adc

erastusC
Associate II

Can any one please assist me.

I have all 8 ADC down to GRND 0V I am using this command:
HAL_ADC_Start_DMA(&hadc1, AD_RES_BUFFER, 8);

 

The arry is:
volatile uint32_t AD_RES_BUFFER[19] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};

All 8 ADC returns between 752 & 759.

The ADC configuration is 

erastusC_0-1749722331189.png

 

erastusC_1-1749722368774.png

 

This is the buffer from the IDE

 

erastusC_2-1749722959738.png

 

 

 

3 REPLIES 3
waclawek.jan
Super User

You appear to convert the same channel over and over, or all channels are at the same voltage.

Read out and check/post the ADC registers content, especially the ADC_SQRx registers.

Do you perform calibration before the conversions, as per the reference manual?

JW

erastusC
Associate II

I did one calibration before the for(;;) loop.

I did not know I must do a calibration for each read.

I don't know what I have done but all of a sudden it is reading correct and I had to ground the input of ADC not connected.

Where can I get the manual you are referring to.

 

erastusC_1-1749743520435.png

 

What I did notice is that I earthed the 

erastusC
Associate II

Crazy,

 

I removed the DMA settings compiled the code, put the DMA settings back compiled the code and now it is working:

Does not make sense at all.

I hope it keeps on working.  But I wonder how stable the IDE is.

erastusC_0-1749807208982.png