Skip to main content
Markus11
Visitor II
March 4, 2021
Question

Does ADC regular conversion in DMA mode and ADC injected conversion in interrupt mode work together using HAL driver? STM32F303

  • March 4, 2021
  • 0 replies
  • 623 views

Hello,

I have 6 ADC channels that shall be launched by software in regular conversion mode. I set the ADC to "End of sequence" and enabled DMA to jump into the callback function when all channels are converted.

This is working fine so far.

I have another channel that shall be trigged by the falling edge of a PWM in injected mode. Therefore, I enabled the interrupts for the injected mode.

When I configure the ADC like this, it only jumps into the interrupt callback of the injected mode and never into the callback of the regular mode.

I use HAL Drivers like this:

// Set up DMA

HAL_ADC_Start_DMA(&hadc1,(uint32_t *)aADC1ConvertedValues, ADCCONVERTEDVALUES1_BUFFER_SIZE)

// software trigger

while(1)

HAL_ADC_Start(&hadc1)

// callback

void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *AdcHandle)

// Start injected conversion

HAL_ADCEx_InjectedStart_IT(&hadc1)

// callback

void HAL_ADCEx_InjectedConvCpltCallback(ADC_HandleTypeDef* hadc)

Do I also need to use interrupt mode for regular conversion? I didn't find an appropriate example so far.

    This topic has been closed for replies.