Yahoo Groups archive

AVR-Chat

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

Message

Vref on ATTiny861a

2010-01-21 by Jeff Blaine AC0C

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]

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.