Using internal voltage reference on 328P

I am trying to port some of my code from ADS1115 to Arduino analog pins that does auto scaling. I am thinking of using the internal 1.1V reference when the input voltage is small. I was reading the source code wiring_analog.c and was under the impression that the multiplexer and voltage reference are on the same register and set at the same time before reading. Then the setting is left unchanged after reading.

So I am just trying to make sure my understanding is correct. In case one channel has say 0.5V and another one has 3.1V, I can auto scale with 1.1V ref on the 0.5V signal, then change reference with AnalogReference(), and then read the other channel with 3.1V signal, without damaging the ADC. Right?

liuzengqiang:
without damaging the ADC. Right?

You can still put 5volt on the analogue pin if Aref is in 1.1volt mode (assuming VCC is 5volt).
It just results in an A/D value of 1023.

The A/D might need a dummy-reading after switching.
Leo..