Skip to main content
PRenn.1
Associate III
January 14, 2025
Question

pls ignore (stm32f411 3 ADC conversions taking forever)

  • January 14, 2025
  • 4 replies
  • 699 views

..

4 replies

mƎALLEm
Technical Moderator
January 14, 2025

Hello,

Please elaborate more and provide more details on the issue.

See Tips on posting.

To give better visibility on the answered topics, please click "Best answer" on the reply which solved your issue or answered your question.
PRenn.1
PRenn.1Author
Associate III
January 14, 2025

I tried to "measure" ADC delay for Measureing 3 Channels by using TIM2 configured for  500 ms per Pariod and used periodelapsed-callback to set the LED pin and call HAL_ADC_Start_DMA for 3 words.
The End would be HAL_ADC_ConvCplt_Callback whihc would reset the led pin.

Expected result : nothing to see because the time the LED would be on would only show up on the oscilloscope.

But i got LED slowly toggle between on and off, at app. 1 Hz.

That would insinuate exzessive ADC conversion time but it was only a measurement error: I may only switch on the LED (and start the next ADC DMA) when the LED was off at the end of a TIM2 period so I tried to get rid of the posting.

However, after changing the code the LED would never extinguish. 

Current verdict:
I'm still not smart enough to get the ADC going with CubeIDE (which has a very shallow learning curve)
or  I've got a STM32F411CEU6 with dead ADC, but nicely workung Timer, GPIO and USB_CDC.

Currently I seeking a program to verify the function of ADC (or DMA).

 

PRenn.1
PRenn.1Author
Associate III
January 14, 2025

Ok, ADC works. 
GND is read as 1,   +5V is read as 4095 and    Channel supended between 2 x 2k2 reads 2978, give or take.

DMA check is next....

PRenn.1
PRenn.1Author
Associate III
January 15, 2025

Must have been me, DMA is oky , too: from Start_DMA till ADC_ConvCpltCallback 9µs
And this is verified, I debugged the DMA output result.