Skip to main content
megahercas6
Associate III
December 2, 2011
Question

Fast and simple adc read

  • December 2, 2011
  • 2 replies
  • 664 views
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++;

}

    This topic has been closed for replies.

    2 replies

    Tesla DeLorean
    Guru
    December 2, 2011
    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 (See Profile) Up vote any posts that you find helpful, it shows what's working..
    megahercas6
    Associate III
    December 2, 2011
    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)