At 08:46 AM 12/30/2003 -0800, Larry Barello wrote: >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. Yeah, that was just "bulletproofing". > Just let er >rip and discard the first conversion - unless that delay you have is to >allow the Aref cap to charge... No, I saw a note about not enabling until one ADC clock after the ref/mux switch. A foof-loop is about twice that. > 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. AH! You got me :) Three bits does not equal 3. :-P 87! >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. It was simpler than that, the voltage that I was trying to measure wasn't turned on yet... 0V.. @#%@^
Message
RE: [AVR-Chat] M128 ADC problem
2003-12-30 by David VanHorn
Attachments
- No local attachments were found for this message.