мой рабочий вариант
функция
unsigned int read_adc(unsigned char adc_input)
{
ADMUX=adc_input | (ADC_VREF_TYPE & 0xff);
// Delay needed for the stabilization of the ADC input voltage
delay_us(10);
// Wait for the AD conversion to complete
while ((ADCSRA & 0x10)==0);
ADCSRA|=0x10;
return ADCW;
}
инцилизация
// ADC initialization
// ADC Clock frequency: 150.000 kHz
// ADC Bandgap Voltage Reference: Off
// ADC Auto Trigger Source: Timer0 Compare Match A
// Digital input buffers on ADC0: On, ADC1: On, ADC2: Off, ADC3: Off
DIDR0&=0x03;
DIDR0|=0x18;
ADMUX=ADC_VREF_TYPE & 0xff;
ADCSRA=0xA6;
ADCSRB&=0xF8;
ADCSRB|=0x03;
[pre/]
ps для tiny13