cancel
Showing results for 
Search instead for 
Did you mean: 

Interrupt mode for ADC reading does not work as expected.

demir
Senior II

hi,

I would like to use HAL_ADC_Start_IT to let the ADC peripheral call interrupt whenever conversion is completed continously. Then I would like to print that converted value via UART.

However, eventhough I select the continous conversion mode enabled, I dont see ADC values changing when I altered the potentiometer. Apparently, HAL_ADC_Start_IT is not called continously.

Please see my code and configuration attached.

On the other hand, when I add the HAL_ADC_Start_IT into callback function as below, then it works as expected. 

Could you pls help me resolve ?

 

 

/* USER CODE BEGIN PFP */

void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef *hadc)

{

adcVal = HAL_ADC_GetValue(&hadc1);

HAL_ADC_Start_IT(&hadc1);

 

}

 

/* USER CODE END PFP */

0 REPLIES 0