analogRead() to ADMUX and back

I'm switching ADMUX to read the 1.1V reference, then using this to calculate the VCC voltage. That topic has been well documented. When that is done, I want to switch the ADMUX back to reading one of the analog input ports on the Arduino. It seems that you can just not reprogram ADMUX to one of the input ports, but that you must use the readAnalog() command to do this. I can read the ADMUX value, see that it has changed, but the conversion result is stuck at the result I got from reading the 1.1V reference. I'm being a little OCD, using analogRead() to do this works just fine, but I would like to understand why I can't just reprogram ADMUX to do this.

thanks,

Steve

You have the source code for analogRead at your fingertips. Whatever it is doing to ADMUX or any other register you can certainly do yourself. Just look at the function and copy out the code you need if you don't want to call it.

Yes, thank you, I understand all of that. Do you think you could possibly tell me which library the readAnalog() function is in so I don't have to spend the next hour searching for it? I assume that it's in the hardware/ardiuno/avr/cores/arduino folder.

Instead of looking for readAnalog, try looking for analogRead - your search'll be much quicker.
It's in something like wiring_analog.c.

stevereine:
I can read the ADMUX value, see that it has changed, but the conversion result is stuck at the result I got from reading the 1.1V reference.

How are you reading the result?
From wiring_analog.c:

        // we have to read ADCL first; doing so locks both ADCL
        // and ADCH until ADCH is read.  reading ADCL second would
        // cause the results of each conversion to be discarded,
        // as ADCL and ADCH would be locked when it completed.
        low  = ADCL;
        high = ADCH;
        
        // combine the two bytes
        return (high << 8) | low;