I would like to have 3.3V and 5V as the reference for my Atmega 2560.
I was thinking of an accurate way to this.
I was hoping to find a reference voltage that can produce two different voltages but I failed in finding such a reference voltage.
Then I thought of adding a resistor to Aref and hooking it up to a reference voltage which produce above 3.3V and considering that datasheet says Aref is 32K, I can exactly calculate the voltage the I need to generate.
I used a 4.7K and used a regulator (to just test the idea) set at 3.785V to see how close to 3.3V I get on Aref when the ADC is using Aref as the reference. The Aref was off by 50mV. I then calculated the Aref resistance and it ended up being 27.5k. I used the same regulator set up and the Aref resistance was different on the other 2 megas I had around (mega 2560 and mega 328). Mega 328 has the closest result and the other mega was also producing better result. I was thinking if it is reliable to design based on 32K? I think even 50mV can be accepted but I am not sure if on other chips the internal resistance remain around the same.
I tried to find similar questions (I honestly think this should be a common problem) but I failed on using the correct terms because I did not find anything that suggest a solution.