I've been working with the EXP430FR5994 launchpad trying to learn the implementation of the LPM modes and obtaining the lowest possible current draw/consumption possible. This is my basic setup and operating loop code: #include #include void initGPIO(void); void initClocks(void); #define greenLED GPIO_PIN1 #define redLED GPIO_PIN0 #define LEDPort GPIO_PORT_P1 #define pushButton1 GPIO_PIN5 #define pushButton2 GPIO_PIN6 #define LF_CRYSTAL_FREQUENCY_IN_HZ 32768 #define HF_CRYSTAL_FREQUENCY_IN_HZ 0 uint32_t myACLK = 0; uint32_t mySMCLK = 0; uint32_t myMCLK = 0; /* * * main.c */ int main(void) { WDT_A_hold(WDT_A_BASE); //Initialization routines initGPIO(); initClocks(); RTC_C_holdClock(RTC_C_BASE); PMM_turnOffRegulator(); //controls LPM.5 mode PMM_disableSVSH(); while(1) { _low_power_mode_4(); //Enter Low Power Mode } } void initClocks(void) { //set the crystal frequencies attached to the LFXT and HFXT oscillator pins //so that driverlib knows how fast they are (needed for the clock 'get' functions) CS_setExternalClockSource( LF_CRYSTAL_FREQUENCY_IN_HZ, HF_CRYSTAL_FREQUENCY_IN_HZ ); //Configure Clocks //Set ACLK to us VLO as its oscillator source (~10kHz) CS_initClockSignal( CS_ACLK, //Clock we're configuring CS_VLOCLK_SELECT, //Clock source CS_CLOCK_DIVIDER_1 //clock divider ); CS_turnOffSMCLK(); //Set the MCLK to use the VLO clock CS_initClockSignal( CS_MCLK, //Clock we're configuring CS_VLOCLK_SELECT, //Clock source CS_CLOCK_DIVIDER_1 //clock divider ); } void initGPIO(void) { #define GPIO_ALL GPIO_PIN0|GPIO_PIN1|GPIO_PIN2|GPIO_PIN3| \ GPIO_PIN4|GPIO_PIN5|GPIO_PIN6|GPIO_PIN7 //set unused pins /* GPIO_setOutputLowOnPin(GPIO_PORT_P1, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_P3, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_P4, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_P5, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_P6, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_P7, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_P8, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_PA, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_PB, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_PC, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_PD, GPIO_ALL); GPIO_setOutputLowOnPin(GPIO_PORT_PJ, GPIO_ALL); PMM_unlockLPM5(); */ GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P1, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P2, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P3, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P4, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P5, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P6, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P7, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_P8, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_PA, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_PB, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_PC, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_PD, GPIO_ALL); GPIO_setAsInputPinWithPullDownResistor(GPIO_PORT_PJ, GPIO_ALL); PMM_unlockLPM5(); } At first I was having trouble getting the hardware to go anything below ~480uA in LMP3, 4 or LPM .5 and there wasn't any change in current consumption when changing between these modes with this code. At first I suspected that I just didn't have everything set right and so I went in register by register to confirm that the register bit fields were set according to the datasheet. They were, so I began to suspect a hardware issue. At which point I started pulling jumpers off of the Launchpad board to see what would happen. I now have J7, J101.5V, J101.RXD, and J101.TXD all removed and with this configuration running the above code it's down to ~70uA of current consumption measured by the EnergyTrace . Based on this I'm wondering how much the hardware platform is getting in the way of achieving values closer to the listed datasheet values or how much of it is still me missing some initialization step which turns off some X module? I also want to point out that in the code segment you can see that instead of setting the pins as output the pins are set as inputs with pulldown resistors. This is not very intuitive since it's counter to the documentation's recommendations to set unused pins as output. If I set pins back to output only, the current draw goes up to ~200uA. Footnote on Page 31 of the datasheet referencing LPM current draw tests (1) All inputs are tied to 0 V or to V . Outputs do not source or sink any current. If outputs do not source or sink any current, what explains the difference in my own testing?
↧