avr-gcc-list
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [avr-gcc-list] ADC sample code in C


From: Matthew Smith
Subject: Re: [avr-gcc-list] ADC sample code in C
Date: Wed, 23 Nov 2005 06:45:07 +1030
User-agent: Mozilla Thunderbird 1.0 (X11/20041206)

James Washer wrote:
> I'm looking for a small piece of sample C source code for playing with the 
> ADC to get me started. Anyone have anything they'd like to share?

Which device?  Internal or external ADC?  I'm pretty sure that I saw an
application note or similar at AVR Freaks for using an internal ADC.  If
it's an external one, you'd be on your own and will need to read the ADC
datasheet.

Last word on external ADCs, at least ones with a byte-wide interface -
if it's got an interrupt out pin (end of conversion), connect it to an
interrupt in on the AVR and handle it with an ISR; DON'T connect it to
GPIO and try to poll it!  (Guess how I know this...)

Cheers

M

-- 
Matthew Smith
Kadina Business Consultancy, South Australia
Work: <http://www.kbc.net.au> Personal: <http://www.mss.cx>





reply via email to

[Prev in Thread] Current Thread [Next in Thread]