Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

RE: [AVR-Chat] M128 ADC problem

2003-12-30 by Larry Barello

I don't see anything wrong with the code, but the documentation is off.

Just a couple notes: you can enable, set the clock and start the first
conversion in one write.  There is no need to delay 15us, etc.  Just let er
rip and discard the first conversion  - unless that delay you have is to
allow the Aref cap to charge...  In any case the first, dummy conversion is
something like 24 cycles long and at 2mhz clock (your doco says 125khz, but
your code selects 2mhz) that should be sufficient.

As to the problem?  Well, is ADCH declared correctly in the header?  I use
the left adjusted, high speed clock ADC on an mega16 and it works like a
champ.  Since you said the normal ADC routines work, I am assuming the Aref
pin is good and not tied to +5v or something like that.

Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.