cancel
Showing results for 
Search instead for 
Did you mean: 

Fast and simple adc read

megahercas6
Senior
Posted on December 02, 2011 at 18:15

Hello, i am working on small oscilloscope,

but i can't get adc value from PC0 leg (ADC123_IN10)

can some one give code or example how to read adc value on demand ?

like that:

while(i<480){

int i,a=0;

a[i]=ADC_READ;

i++;

}

2 REPLIES 2
Posted on December 02, 2011 at 20:50

I'm pretty sure you're going to have to wait for the conversion to complete, as it is not an instantaneous process. Either have it converting on a period basis, or initiate the conversion before you need the result.

The fw library has several clear ADC examples as I recall.

You could abstract ADC_READ as a function that waits for the current conversion to complete, returning that result after starting another conversion.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
megahercas6
Senior
Posted on December 02, 2011 at 22:34

i found working code for my application in examples folder.

now i have nice looking oscilloscope :)

thank you clive1 for continuous help (y)