according to the atmega1280 specification, the internal reference voltage can be selected at either 1.1v or 2.56v. (not just 2.56v, as the wiki suggests)
The analogReference(uint8_t mode) function simply sets a variable that is (later) used by analogRead(uint8_t pin) to set bits 6 and 7 (REFS1:0) of the ADMUX register. (These details can be observed in .../arduino/hardware/cores/arduino/wiring_analog.c) The REFS1:0 bits determine the source of the reference voltage as follows:
|REFS1||REFS0||Voltage reference selection|
|0||0||AREF, internal Vref off|
|1||0||Internal 1.1v Voltage reference|
|1||1||Internal 2.56v Voltage reference|
.../arduino/hardware/cores/arduino/wiring.h only makes the following defines:
#define INTERNAL 3
#define DEFAULT 1
#define EXTERNAL 0
as you can see - there is no definition for the internal 1.1vref.
Adding the following to wiring.h will allow you to select an internal 1.1v voltage reference:
#define INTERNAL_1V1 2
#define INTERNAL_2V56 3 //added for completeness
selecting the analog reference is as simple as:
of course, INTERNAL_1V1 is just a macro... to use the internal 1.1v reference without modifying any of the arduino code, simply use the following:
I have tested this and can easily switch between an internal reference voltage of 1.1v or 2.56v. I hope this comes in handy!
I do NOT know how this will behave on other hardware - hence the '#if defined(__AVR_ATmega1280__)' - consult your hardware manual!