My test Energia based program simply checks reference voltage in loop() and goes into LP3 sleep for 10 seconds. When I set analogReference to DEFAULT, the current consumption in sleep mode barely registers on my ammeter. Unfortunately, DEFAULT is not useful for internal voltage measurement. When I use INTERNAL2V5, for proper measurement, I run into a serious problem. In sleep mode, the launchpad draws about 180uA. Ouch!
That is when I thought of setting analogReference to INTERNAL2V5 just before measuring voltage and then back to DEFAULT after. That did not help. Its still drawing 180 uA.
The code snippet shows what I'm trying to do. I've stripped out everything else to find the culprit. LP3 sleep mode isn't working as expected when using analogReference(INTERNAL2V5) :-(. Am I doing something wrong? How can I conserve battery life?
void setup()
{
// Use the 2.5V internal reference
analogReference(INTERNAL2V5);
//analogReference(DEFAULT);
}
void loop()
{
// Get battery voltage
//analogReference(INTERNAL2V5);
int v = analogRead(11);
//analogReference(DEFAULT);
sleepSeconds(10);
}