Page 1 of 1

ADC burst mode?

Posted: Wed Feb 04, 2015 9:30 am
by speedracer
I'm not sure how many folks might need this but I would dearly love to have a burst mode for the INADC command. My ideal command would be:

ARRAY = INADC(<pin#>,<number of samples>,<time between samples>)

The ADC on the LP2138 claims speeds up to 2.4 uSec between samples. I would be happy with multiples of 10 uSec. I'm thinking of an application that would need 128 samples per burst but more would be better, of course.

Calling INADC with only one parameter could operate just as it does now.

Here's hoping...

Re: ADC burst mode?

Posted: Wed Feb 04, 2015 9:26 pm
by Daniel
That is reasonable. I'll implement it as soon as I get a chance. I don't think I have a provision for returning an array of results so it may need to be a parameter.
Daniel

Re: ADC burst mode?

Posted: Thu Feb 05, 2015 9:31 am
by speedracer
Even just a pointer into RAM would work. A loop with PEEKS could retrieve the data. When you need a set of evenly-spaced samples of something, usually you have ample time after the event to process the data before the next set of samples are taken.

Or ... could you pass the address of an array to the call? (I know much more about the structure of FORTH than I do about your BASIC; passing addresses in FORTH is very common.)