Page 1 of 1

ADC callback throughput (solved)

Posted: Thu Oct 25, 2012 9:33 am
by z80
Hi all!

I have a couple of questions related to ADC callback invocation frequency.

1) Does it explicitly depend on task switch frequency? In other words, is ADC callback called exactly after physical convertion or when nearest task switch occurs? And what kind of functions should I use inside of the callback, regular or ISR ones? May I get fast ADC conversion rate with relatively small task switch frequency to not waste MCU performance on unnecessary task switches?

2) In the case of circular ADC mode does next convertion start just after previous one or only after leaving callback function? What would happen if it takes more time to execute ADC callback then to perform pending convertion? Is there any kind of callbacks queue? Or should ADC callback be made to return as fast as possible?

Thank you very much in advance!

Re: ADC callback throughput

Posted: Thu Oct 25, 2012 9:42 am
by Giovanni
Hi,

All kind of callbacks are invoked from ISR context and are not linked to task switching. The ADC callback is code called directly from the ADC ISR and must use APIs meant for ISRs.

Giovanni

Re: ADC callback throughput

Posted: Thu Oct 25, 2012 10:24 am
by z80
Thank you very much! All is brief and clear!