I have a program on the Arduino UNO Board that reads one analog pin with analogRefernce(DEFAULT), if this value ist below 200 it changes the analog reference to INTERNAL and reads the value again, to spread the accuracy. But this does not work as expected I always get nearly the same value as with the DEFAULT-Reference and not as expected an approx. four times value.
After experimenting for a while and finding something related here in the discussion boards, I did a for loop for the second reading that reads the value with the INTERNAL-Reference twenty times and printing it to serial console. The measured values are starting with an value like the reading with the DEFAUL-Reference and then increasing with each reading. Reaching a stable value as expected about 4 times the first reading after 7 to 10 readings. So I use this for loop as an workaround only using the last value I got after changing the analogReference.
Can someone explain me why this happens? Is it the same for other arduino boards?
If this is by hardware design and not a bug in the firmware. It should be mentioned with an example on the documentation page for analogReference();. I had some very hard hours before finding my solution, thinking i did something wrong.