[ECOS] ADC polling vs. ADC generated interrupt

Uwe Kindler uwe_kindler@web.de
Sun Dec 28 14:51:00 GMT 2008


Hello Peter,

the current implementation of the ADC driver for the LPC24xx is 
efficient because it requires only one single interrupt to service up to 
8 ADC channels at the same time. All active channels will be read in one 
single ISR. The interrupt frequency is as high as the configured sample 
rate. That means if you only need 10 samples per second per channel then 
the timer ISR will be serviced 10 times per second.

Another advantage of the current implementation is, that it is possible 
to use the eCos ADC driver and application specific ADC polling at the 
same time. That means you could use the buffered eCos ADC driver for the 
first 4 ADC channels and you could poll the remaining 4 channels without 
using the eCos ADC driver.

The current implementation would not work for LPC22xx varaints because 
they do not have per channel A/D data registers. For LPC22xx and LPC21xx 
variants you need a solution that raises an interrupt for each single 
A/D conversion and then you would read the A/D value from the ADDR 
register. You would need a timer channel to generate the correct 
sampling frequency and you would need the ADC interrupts to read the 
data from the ADDR register.

Because of these differences I think it would be better to create a 
separate ADC driver for former LPC2xxx variants.

Regards, Uwe

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss



More information about the Ecos-discuss mailing list