Skip to main content
Graduate
January 19, 2024
Question

ADC Interrupt Callback

  • January 19, 2024
  • 3 replies
  • 1760 views

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 .

    This topic has been closed for replies.

    3 replies

    ST Employee
    January 22, 2024

    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

    Graduate
    January 22, 2024

    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.

    Graduate II
    June 19, 2024

    @raptorhal2 wrote:

    [...]

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


    That would have been my first idea as well, unfortunately as of STM32Cube_FW_G4_V1.5.2 there's no such example.

    Tushar_4Author
    Graduate
    January 24, 2024

    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. 

    Graduate
    January 24, 2024

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

    I use breakpoints to locate problems.