cancel
Showing results for 
Search instead for 
Did you mean: 

ADC DMA TIM - U5XX Family

Marc3
Associate

Good afternoon, 

 

I have a question regarding the best strategy to follow on how to measure multiple channels with the ADC (triggered with timer) and map them to the DMA.

 

I have followed the project called ADC_DMA_Transfer that can be found in the Project's folder of the U575 family and it works and i can see in my buffer the 5 values of the ADC that i want to monitor in continuous conversion mode. However this solution creates an ADCQueue and an ADCNode (I do not really know what it is). 

/* USER CODE BEGIN 2 */

  MX_ADCQueue_Config();

  __HAL_LINKDMA(&hadc4, DMA_Handle, handle_GPDMA1_Channel10);

  if (HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel10, &ADCQueue) != HAL_OK)
  {
    Error_Handler();
  }
  if (HAL_ADC_Start_DMA(&hadc4, (uint32_t *)aADCxConvertedData, (ADC_CONVERTED_DATA_BUFFER_SIZE)                    ) != HAL_OK)
  {
    Error_Handler();
  }

  __HAL_LINKDMA(&hadc4, DMA_Handle, handle_GPDMA1_Channel3);

  if (HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel3, &ADCQueue) != HAL_OK)
  {
    Error_Handler();
  }

  __HAL_LINKDMA(&hadc4, DMA_Handle, handle_GPDMA1_Channel4);

  if (HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel4, &ADCQueue) != HAL_OK)
  {
    Error_Handler();
  }

  __HAL_LINKDMA(&hadc4, DMA_Handle, handle_GPDMA1_Channel9);

  if (HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel9, &ADCQueue) != HAL_OK)
  {
    Error_Handler();
  }

  __HAL_LINKDMA(&hadc4, DMA_Handle, handle_GPDMA1_Channel11);

  if (HAL_DMAEx_List_LinkQ(&handle_GPDMA1_Channel11, &ADCQueue) != HAL_OK)
  {
    Error_Handler();
  }

I do not really know how to implement the timer2 to trigger the ADC but i have found the following video https://www.youtube.com/watch?v=pLsAhJ8umJk in which is not using the strategy that can be found on the projects of the U575 family. 

 

Why this two different approaches? Can i implement my solution with both projects? 

 

Thank you,

 

Marc

 

 

1 REPLY 1
Sarra.S
ST Employee

Hello @Marc3

>>However this solution creates an ADCQueue and an ADCNode (I do not really know what it is). 

This involves creating a queue of DMA requests and linking them to the ADC handle, you can check this article:

How to configure the linked list mode in STM32Cube... - STMicroelectronics Community

>>I do not really know how to implement the timer2 to trigger the ADC

You can start with this hands-on: 

Hands-On with STM32 Timers: Trigger Periodic ADC Conversions 

Using Timers to Trigger ADC conversions periodical... - STMicroelectronics Community

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.