Fast and simple adc read
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-12-02 9:15 AM
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 discussion is locked. Please start a new topic to ask your question.
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-12-02 11:50 AM
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..
Up vote any posts that you find helpful, it shows what's working..
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
‎2011-12-02 1:34 PM
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)