Reply 20 of 22, by SirNickity
The problem with offset correction in code is that you have to know for sure that offset never changes. Unless the reference is reasonably stable across supply voltage and temperature fluctuations, it's still not very precise even if you can calibrate it to bang-on at 20C on a fresh battery. Just something to be aware of, in case you haven't thought about it yet.
It's true you can damage the Vref circuit if you set the voltage reference to internal and have an external voltage source connected as well. In a decision that is either questionable or efficient -- I'm not really sure which -- the Vref pin becomes an external exposure of the internal voltage reference when the internal Vref is selected. This allows you to apply additional filtering to reduce noise, or even (buffer it! and) use it for other references.
As with any software-selectable input / output pin, you have to be careful to match up the initialization code with the hardware topology. Not much different than the port I/O pins themselves, really, except when using pre-baked firmware like the Arduino library, you don't always know for sure what's being done for you. Kind of a good reason to graduate to straight AVR C, IMO, but that's obviously not a reasonable option for everyone. Arduino got me into embedded programming and digital electronics, and I'm grateful for that. But I was also quite relieved when I got through my first successful Atmel Studio project.