I've been working a bit with the mega48 A/D..All is pretty well, though I suddenly needed to switch back and forth between the references (AVcc & 1.1 internal bandgap), due to one of my channel voltages being rather small. I took the datasheet advice to discard the 1st reading after switching refs, but my results made no sense at all. It was quite tough to figure out--changed code,etc. None of the errors made sense logically. The program appeared perfect!
What the datasheet lacks is the fact that any cap on Vref will require a DELAY when switching the ref voltage, due to the charge time. Merely doing a 2nd conversion alone (right away) is not enough! Has anyone else run into this "gotcha" ? It really is simple to fix, once you know the source of the trouble. Otherwise you'll inspect your code forever with no error found.