AnsweredAssumed Answered

ADC with DMA triggered by software

Question asked by smrtkai on Jun 22, 2016
Latest reply on Jun 27, 2016 by smrtkai
Hi,
I would like to trigger the ADC conversion with DMA via a software command. I tried several configurations but I haven't succeed yet. The simplest thing would be to push a button and the ADC starts converting and after 10 conversion the DMA complete callback is invoked.

This is what I think should be the right correct, but does not work. I have configured my code using STM32CubeMX.

Scan Conversion: Disabled (Only one channel should be converted)
Continuous Conversion Mode: Enabled (Convert until DMA is full)
DMA Continuous Requests: Disabled (Should be triggered via software)

Using the following commands the conversion works one time (DMA callback is invoked). How can I restart the ADC conversion so that the callback is invoked again? I tried to stop the ADC and start it again. But it does not work.

  HAL_ADC_Start(&hadc1);
  HAL_ADC_Start_DMA(&hadc1, (uint32_t*) input_data, 10);  

Can anyone?

Outcomes