cancel
Showing results for 
Search instead for 
Did you mean: 

ADC with DMA

Nsg1987
Senior

Hello,

I succefully figured out to scan ADC1 and ADC2 (countinous mode) with DMA. The issue is that by doing above, controller remains busy and no counter update in while(1). If I disable the ADC start then counter starts working. could you please help me to resolve.

HAL_TIM_PWM_Start(&htim1, TIM_CHANNEL_1); //start the timer

       HAL_TIMEx_PWMN_Start(&htim1, TIM_CHANNEL_1); //COMPLEMENTRY OPUTPUT

       HAL_TIM_OC_Start(&htim1, TIM_CHANNEL_2);

       HAL_TIM_PWM_Start(&htim8, TIM_CHANNEL_1);

       HAL_TIMEx_PWMN_Start(&htim8, TIM_CHANNEL_1); //COMPLEMENTRY OPUTPUT

       HAL_TIM_OC_Start(&htim8, TIM_CHANNEL_2);

       HAL_TIM_PWM_Start(&htim20, TIM_CHANNEL_1);

       HAL_TIMEx_PWMN_Start(&htim20, TIM_CHANNEL_1); //COMPLEMENTRY OPUTPUT

       HAL_TIM_Base_Start_IT(&htim3); // this will start the interrupt for core algo

       HAL_DAC_Start(&hdac1, DAC_CHANNEL_1);

       HAL_ADC_Start (&hadc2); //START ADC2 BEFORE ADC2 IN MULTIMODE .. ADC2 Ch 1,2

       HAL_ADCEx_MultiModeStart_DMA (&hadc1, (uint32_t*)ADC1Samples, //DUAL OPERATION OF ADC1 AND ADC2 ....  ADC1 Ch 3,4

/* USER CODE END 2 */

 /* Infinite loop */

 /* USER CODE BEGIN WHILE */

 while (1)

 {

  /* USER CODE END WHILE */

 counter +=1;

  /* USER CODE BEGIN 3 */

 }

 /* USER CODE END 3 */

}

0 REPLIES 0