Hi Rob, We are actually in the process of updating all of our code examples to support Rev C silicon - thanks for your patience here. Please keep in mind that the purpose of this code example is to highlight the ADC functionality, and it's not purpose-built for low-power. I noticed that this code example uses Flash Wait State 2 for RevB, but now RevC can operate at 48 MHz using Flash Wait State 1 instead. This may not decrease power consumption, but it should increase performance. For your reference, take a look at the Designing an Ultra-Low-Power (ULP) Application With MSP432™ Microcontrollers app note. It features several power optimization strategies and should be helpful for your application, including when to use the DC-DC converter instead of the LDO for better efficiency. Also, refer to Section 2.3.5 of the LaunchPad's User's Guide for the most accurate current measurement method, which includes making sure there are no floating I/O pins (this is done in the 'msp432p401_pcm_02.c' code example below) and accounting for the back-channel UART and any circuitry connected to the MSP432 that may be drawing additional current (which would explain why your custom board consumes slightly more current). /* --COPYRIGHT--,BSD_EX * Copyright (c) 2013, Texas Instruments Incorporated * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of Texas Instruments Incorporated nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ******************************************************************************* * * MSP432 CODE EXAMPLE DISCLAIMER * * MSP432 code examples are self-contained low-level programs that typically * demonstrate a single peripheral function or device feature in a highly * concise manner. For this the code may rely on the device's power-on default * register values and settings such as the clock configuration and care must * be taken when combining code from several examples to avoid potential side * effects. Also see www.ti.com/.../mspdriverlib for an API functional * library & https://dev.ti.com/pinmux/ for a GUI approach to peripheral configuration. * * --/COPYRIGHT--*/ //****************************************************************************** // MSP432P401 Demo - Enter LPM3 with ACLK = REFO // // Description: MSP432 device is configured to enter LPM3 mode with GPIOs properly // terminated. P1.1 is configured as an input. Pressing the button connect to P1.1 // results in device waking up and servicing the Port1 ISR. LPM3 current can be // measured when P1.0 is output low (e.g. LED off). // // ACLK = 32kHz, MCLK = SMCLK = default DCO // // // MSP432p401rpz // ----------------- // /|\| | // | | | // --|RST | // /|\ | | // --o--|P1.1 P1.0|-->LED // \|/ // // Dung Dang // Texas Instruments Inc. // October 2015 (updated) | November 2013 (created) // Built with Code Composer Studio V6.0 //****************************************************************************** #include "msp.h" int main(void) { /* Hold the watchdog */ WDTCTL = WDTPW | WDTHOLD; /* Configuring P1.0 as output and P1.1 (switch) as input with pull-up resistor*/ /* Rest of pins are configured as output low */ /* Notice intentional '=' assignment since all P1 pins are being deliberately configured */ P1DIR = ~(BIT1); P1OUT = BIT1; P1REN = BIT1; // Enable pull-up resistor (P1.1 output high) P1SEL0 = 0; P1SEL1 = 0; P1IFG = 0; // Clear all P1 interrupt flags P1IE = BIT1; // Enable interrupt for P1.1 P1IES = BIT1; // Interrupt on high-to-low transition // Enable Port 1 interrupt on the NVIC NVIC->ISER[1] = 1 KEY = CS_KEY_VAL ; CS->CTL1 &= ~(CS_CTL1_SELA_MASK | CS_CTL1_SELB); CS->CTL1 |= CS_CTL1_SELA__LFXTCLK; // Source LFXTCLK to ACLK & BCLK CS->CTL2 &= ~(CS_CTL2_LFXTDRIVE_MASK); // Configure to lowest drive-strength CS->CTL2 |= CS_CTL2_LFXT_EN; while (CS->IFG & CS_IFG_LFXTIFG) CS->CLRIFG |= CS_CLRIFG_CLR_LFXTIFG; CS->KEY = 0; /* Turn off PSS high-side supervisors */ PSS->KEY = PSS_KEY_KEY_VAL; PSS->CTL0 |= PSS_CTL0_SVSMHOFF; PSS->KEY = 0; /* Enable PCM rude mode, which allows to device to enter LPM3 without waiting for peripherals */ PCM->CTL1 = PCM_CTL0_KEY_VAL | PCM_CTL1_FORCE_LPM_ENTRY; /* Enable all SRAM bank retentions prior to going to LPM3 */ SYSCTL->SRAM_BANKRET |= SYSCTL_SRAM_BANKRET_BNK7_RET; __enable_interrupt(); SCB->SCR |= SCB_SCR_SLEEPONEXIT_Msk; // Do not wake up on exit from ISR /* Setting the sleep deep bit */ SCB->SCR |= (SCB_SCR_SLEEPDEEP_Msk); /* Go to LPM3 */ __sleep(); } /* Port1 ISR */ void PORT1_IRQHandler(void) { volatile uint32_t i, status; /* Toggling the output on the LED */ if(P1IFG & BIT1) P1OUT ^= BIT0; /* Delay for switch debounce */ for(i = 0; i < 10000; i++) P1IFG &= ~BIT1; } Hope this helps. Regards, James MSP Customer Applications
↧