Hello,
I am trying to save battery power through using the hibernation mode. But I found that the battery is still consumed and the power led D2 is always lit. Is there a method to turn off this led ? Or is there any other method to power the launchpad away from the usual USB debug/device and VBUS, where all these three methods light the power led.
The used code is simple where it hibernate the launchpad for 50 seconds and turn on the led on board for 4 seconds. I have drained a 6000mAh battery in less than 10 days !
The code
#include "inc/hw_memmap.h"
#include "inc/hw_types.h"
#include "inc/hw_gpio.h"
#include "driverlib/sysctl.h"
#include "driverlib/gpio.h"
#include "driverlib/timer.h"
#include "driverlib/pin_map.h"
#include "driverlib/hibernate.h"
int main(void){
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE,GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3 , 0x08); //light the green led
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_HIBERNATE);
HibernateEnableExpClk(SysCtlClockGet());
HibernateGPIORetentionEnable();
//
HibernateRTCSet(0);
HibernateRTCEnable();
HibernateRTCMatchSet(0,50);
HibernateWakeSet(HIBERNATE_WAKE_PIN | HIBERNATE_WAKE_RTC);
SysCtlDelay64000000);
GPIOPinWrite(GPIO_PORTF_BASE,GPIO_PIN_3, 0x00); //shut down the led
HibernateRequest();
}