I have an Atmega328P connected on a breadboard with an MCP1700 Voltage regulator and a voltage divider. The Atmega is connected directory to the battery voltage (5v). I then feed Aref with a stable 3.3v from the MCP1700 and read that battery voltage using a voltage divider. It's activated by the Atmega through an NPN transistor. I currently use low-side switching because I don't have any FETS available. However, this works fine and consumes 7 microamps of energy in deep sleep.
I then tried powering everything from the voltage regulator (except the voltage divider itself, because I still need that to read the actual battery voltage). So AVCC, AREF, VCC are all now powered through the output of the regulator. Something weird happened, suddenly I'm consuming 60 microamps of energy during sleep. I narrowed this down to being current flowing into the analog input pin.
I don't understand, why does this happen when connected directly to the regulator?