cancel
Showing results for 
Search instead for 
Did you mean: 

STM32H563 ADC Discontinuous Mode

mccabehm
Senior

Exploring ADC discontinuous mode with interrupts. Any issues calling HAL_ADC_Start_IT() from ADC ISR? Looks like a lot of code to run from an ISR.

1 ACCEPTED SOLUTION

Accepted Solutions
Saket_Om
ST Employee

Hello @mccabehm 

The recommended approach is to avoid calling HAL_ADC_Start_IT() from within the ADC interrupt service routine (ISR) or its callback function. Instead, you should set a flag inside the ISR or callback to indicate that the ADC conversion has completed. Then, in your main loop check this flag and call HAL_ADC_Start_IT() to start the next conversion.

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.
Saket_Om

View solution in original post

1 REPLY 1
Saket_Om
ST Employee

Hello @mccabehm 

The recommended approach is to avoid calling HAL_ADC_Start_IT() from within the ADC interrupt service routine (ISR) or its callback function. Instead, you should set a flag inside the ISR or callback to indicate that the ADC conversion has completed. Then, in your main loop check this flag and call HAL_ADC_Start_IT() to start the next conversion.

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.
Saket_Om