I’m using an ATMEGA8 and trying to get the ADC to work.
I have a 10k potentiometer connected between two 330 ohm resistors, and according to my multimeter this yields a linearly varying voltage of 0.16V to 4.85V.
Unfortunately, when I read ADCL and ADCH after a conversion, ADCL only varies from 0 to 64 and ADCH is always 0.
I’ve used Vcc as a reference voltage, and I’ve also tried connecting 5V to AREF and using that.
Have you configured the ADMUX register and double checked that you’ve selected the correct channel and reference?
Maybe post your code so we can see how your are starting the conversion and getting the result. If you read the result out of ADCL and ADCH before the conversion is completed, you won’t get the proper reading.