ADC callback throughput (solved)

ChibiOS public support forum for all topics not covered by a specific support forum.

Moderators: RoccoMarco, lbednarz, tfAteba

Post Reply
User avatar
z80
Posts: 20
Joined: Mon Oct 08, 2012 5:36 pm

ADC callback throughput (solved)

Post 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!
Last edited by z80 on Thu Oct 25, 2012 10:25 am, edited 2 times in total.
User avatar
Giovanni
Site Admin
Posts: 14895
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: ADC callback throughput

Post 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
User avatar
z80
Posts: 20
Joined: Mon Oct 08, 2012 5:36 pm

Re: ADC callback throughput

Post by z80 »

Thank you very much! All is brief and clear!
Post Reply