I need to “shut down” the internal Vref of the ATMega1284p, because I have an external precision Vref. I’m looking for a valid method to shut it down as default BEFORE any other “activity”, because, according to my current options, it’s too easy to forget a simple line of code. The goal is to avoid this little mistake that results in increasing power consumption and heating of both vref and voltage regulator chips.
My options are:
- in sketch setup
- ADMUX &= ~((1<<REFS1) | (1<<REFS0)); (does the same as above)
- or, in Wiring_analog.c, setting analog_reference to EXTERNAL.
- uint8_t analog_reference = EXTERNAL;
All above solutions work perfectly, but I’m wondering if there’s another way to do it (e.g. in the bootloader, in fuses etc.). I spent a lot of time reading Atmel documentation and searching on the internet, but I haven’t found a way to do it.
I think I could exclude fuses setting because there’s no specific bit affecting internal voltage reference. I also think that through the bootloader I could implement something in order to reach the goal. Unfortunately this looks, at the moment, above my comprehension.