I'm developing a project which requires the use of the internal ADC to monitor battery voltage. I had designed a "breakout board" for the mega169 to allow access to the various I/O pins. I wrote my ADC code to select ADC0 as the input, and the internal 1.1 volt reference. I could not get any kind of rational result from the ADC. After hours of trying a variety of "fixes", I found that little note in the data sheet - "If the user has a fixed voltage source connected to the AREF pin, the user may not use the other
reference voltage options in the application, as they will be shorted to the external voltage." I had tied the AREF to AVCC on my board :-(
I carefully pried pin 62 (AREF) from my board (as the track to which is was attached was beneath the device), carefully soldered a small tantalum cap across it to ground, and tried again. The reference voltage on the cap shows 1.08 volts, and if I select either ground or the 1.1 volt reference in the ADMUX, I get a good result. However - if I select any external ADC input, I always get 0x03ff as the result, no matter what the actual voltage is.
I am assuming that this means I have tanked my mega169, correct? Any other options I should try before replacing the device?