Hi Jeff, What results are you seeing from the ADC with this code? What voltage have you got on Vref? What else have you tried? Dave. From: AVR-Chat@yahoogroups.com [mailto:AVR-Chat@yahoogroups.com] On Behalf Of Jeff Blaine AC0C Sent: 21 January 2010 17:47 To: AVR-Chat@yahoogroups.com Subject: [AVR-Chat] Vref on ATTiny861a I am having a tough time getting this chip to respond to any other ADC voltage reference than the default AVcc. The code snip is really simple... Below, using the MakroC Pro compiler, however the results seem to be the same if I do the same using ASM instructions instead of their bit-level defines. I must be overlooking something. It seems so simple, driving me nuts that it's not working right. I have used the same compiler and basic code to get a mega328 to work. Appreciate any suggestions the group may have. Thanks/jeff REFS0_bit = 1; // 001 invokes external Vref as ADC reference ADEN_bit = 1; // enable adc ADSC_bit = 1; // start conversion while(adsc_bit); lb=ADCL; // get lower byte ub=ADCH; // get upper byte adc_rd0 = (256*ub) + lb; // build number [Non-text portions of this message have been removed]
Message
RE: [AVR-Chat] Vref on ATTiny861a
2010-01-21 by Dave McLaughlin
Attachments
- No local attachments were found for this message.