cancel
Showing results for 
Search instead for 
Did you mean: 

ADC Interrupt Callback

Tushar_4
Associate II

I am using multiple channel and multiple ADC's and I am trying to use the Interrupt method ,

My first doubt was lets say we are using End Of Sequence Conversion flag So, the interrupt will be triggered when all conversion will be complete then how we will get all the converted value or I should use End Of Single Conversion.

Second was , Lets say I have 8 Channels to convert in ADC1 , So will the Sample Conversion Time be Added for the 8 channels in a sequence like 640.5+640.5 ADC Clock cycles ..... or it will be 640.5 only Or does it depend on the Flag of conversion .

4 REPLIES 4
Billy OWEN
ST Employee

Hi @Tushar_4 

 

The forum moderator had marked your post as needing a little more investigation and direct support. An online support case has been created on your behalf, please stand by for just a moment and you will hear from us.

 

Regards,

Billy

raptorhal2
Lead

My first doubt was......

For multiple channels, use DMA to save the results in a buffer.

Second was......

Configure each channel for the Sample time needed. Yes, the time will be added for a sequence of channels.

I recommend looking at the ADC DMA examples provided with the HAL Library package for your processor.

Tushar_4
Associate II

Can we use User context pointer as the way to check if let's say in the context we can pass the ADC Module and Channel number then when the conversion is complete than we check its instance and channel number and assign the value to the respective variable , then if the callback is triggered for the second time then we can again check the user context.

Is this a good approach ?

Thanks in advance. 

I'll be honest - I have no knowledge of User context pointer. Perhaps someone else can educate us.

I use breakpoints to locate problems.