Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.

#1 Nov. 22, 2005 18:31:01

James W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


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?

thanks

- jim


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#2 Nov. 22, 2005 20:14:25

Matthew S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


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>



_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#3 Nov. 23, 2005 05:48:42

James W.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


mega8 or so.. internal... yes, I can imagine polling external would be a pain.

- jim

On Wed, 23 Nov 2005 06:45:07 +1030
Matthew Smith <> wrote:

> 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>
>
>
>
> _______________________________________________
> AVR-GCC-list mailing list
> AVR-GCC-l***@*ongnu.org
>http://lists.nongnu.org/mailman/listinfo/avr-gcc-list>


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

#4 Nov. 25, 2005 18:15:47

Hinko K.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

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


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?Check avrlib package...

regards,
hinko


_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.orghttp://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Offline

Board footer

Moderator control

Enjoy the 22nd of April
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support