Skip to main content
Riccardo Franceschetto
Associate III
March 31, 2023
Question

What woul be the best way to read ADC in an RTOS?

  • March 31, 2023
  • 1 reply
  • 1105 views

I'd like to get ADC readings, implemented with DMA while running in an RTOS.

The problem is that the ADC with DMA interrupts the RTOS... don't know what could be the cause maybe interrupts conflicting?

This topic has been closed for replies.

1 reply

ST Employee
March 31, 2023

Hello @Riccardo Franceschetto​ 

I think you should configure the DMA controller to trigger an interrupt only when a buffer is completely filled! have you tried that?

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.
Riccardo Franceschetto
Associate III
April 3, 2023

Hello Sarra,

I created a one element array, so the HAL_ADC_ConvCpltCallback get called every sample the adc feeds to the DMA.

Theoretically this should be a good implementation, but practically i think i'm stopping the GUI too frequently.