This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

High Current Draw on MSP-EXP430FR5739 Bemo Board

I took a simple example program that output's PWM using Timer A based off a TI code example code and successfully compiled it in CCS 6.0.1.00040 as follows...

//*******************************************************************************
//  MSP430FR57x Demo - Timer0_A3, PWM TA0.1-2, Up Mode, DCO SMCLK
//
//  Description: This program generates two PWM outputs on P1.0,P1.1 using
//  Timer0_A configured for up mode. The value in CCR0, 1000-1, defines the PWM
//  period and the values in CCR1 and CCR2 the PWM duty cycles. Using ~1MHz
//  SMCLK as TACLK, the timer period is ~1ms with a 75% duty cycle on P1.0
//  and 25% on P1.1.
//  ACLK = n/a, SMCLK = MCLK = TACLK = 1MHz
//
//
//           MSP430FR5739
//         ---------------
//     /|\|               |
//      | |               |
//      --|RST            |
//        |               |
//        |     P1.0/TA0.1|--> CCR1 - 75% PWM
//        |     P1.1/TA0.2|--> CCR2 - 25% PWM
//
//   Priya Thanigai
//   Texas Instruments Inc.
//   August 2010
//   Built with IAR Embedded Workbench Version: 5.10 & Code Composer Studio V4.0
//******************************************************************************

#include <msp430.h>


int main(void)
{
  WDTCTL = WDTPW + WDTHOLD;                 // Stop WDT  
  CSCTL0_H = 0xA5;							// this is the passkey that allows writing to the CSxxx registers
  CSCTL1 |= DCOFSEL0 + DCOFSEL1;            // Set max. DCO setting =8MHz
  CSCTL2 = SELA_3 + SELS_3 + SELM_3;        // set ACLK = SMCLK = DCO/8
  CSCTL3 = DIVA_3 + DIVS_3 + DIVM_3;        // set all dividers 


  P1DIR |= BIT0+BIT1;                       // P1.0 and P1.1 output
  P1DIR |= BIT0;                            // P1.0 output
  P1SEL0 |= BIT0+BIT1;                      // P1.0 and P1.1 options select
  P1SEL0 |= BIT0;                           // P1.0 select
  TA0CCR0 = 256-1;                          // PWM Period
  TA0CCTL1 = OUTMOD_7;                      // CCR1 reset/set
  TA0CCR1 = 200;                            // CCR1 PWM duty cycle
  TA0CCTL2 = OUTMOD_7;                      // CCR2 reset/set
  TA0CCR2 = 50;                             // CCR2 PWM duty cycle
  TA0CTL = TASSEL_2 + MC_1 + TACLR;         // SMCLK, up mode, clear TAR

  __bis_SR_register(LPM0_bits);             // Enter LPM0
  __no_operation();                         // For debugger
}

It works but the draw is around 5 mA, I was running something very similar on a MSP-EXP430G2 board and drawing under 60 uA.  Cleary 5 mA is WAAAAYYY more than I was expecting.

I'm measuring the current using the MSP_PWR jumper pins.

Any ideas?

  • Hi Ted,

    I did a little experimenting with your code on a EXP430FR5739 board, and I think the root cause of your current issue is not initializing unused pins to output low.  The EXP430FR5739 board has a bunch of additional hardware that is connected to the 430's GPIO pins, and when the pins are floating, it is possible for them to source/sink current.  Forcing all the unused pins to output low prevents this additional current draw.


    When I added this to your code, I noticed the current decrease from ~4.3mA to ~175uA, almost exactly the datasheet typical value.  The exact change I made was to add these lines:

      P1DIR = 0xFF;
      P1OUT = 0;
      P2DIR = 0xFF;
      P2OUT = 0;
      P3DIR = 0xFF;
      P3OUT = 0;
      P4DIR = 0xFF;
      P4OUT = 0;
      PJDIR = 0xFF;
      PJOUT = 0;

    just before these lines:

      P1DIR |= BIT0+BIT1;                       // P1.0 and P1.1 output
      P1DIR |= BIT0;                            // P1.0 output
      P1SEL0 |= BIT0+BIT1;                      // P1.0 and P1.1 options select
      P1SEL0 |= BIT0;                           // P1.0 select
    

    Try this and see if your current numbers improve.

    Mike

  • Mike,

    That was it!

    Thanks for the response.  I am fairly new to MSP430 and had wondered about port initialization, I guess they default to inputs?  After the changes you suggested, I went down to 6 uA on my meter and that is a number I can definitely live with.

    This is truly amazing, a micro-controller running an internal clock at 1 MHz outputting controlled PWM and drawing just 6 uA.

  • Actually, I realize that my Fluke 87V meter defaults to AC uA and I should have had it on DC uA so now I see that it pulls 170 uA so I assume that you meant uA, not nA?

  • Ted Mawson said:
    I assume that you meant uA, not nA

    You are correct, I meanut uA, not nA.  I will update the above post.

    Thanks,

    Mike

  • Thanks for the confirmation Mike.

    I'm keen to get down to 60 uA or less; I see I can run the DCO at 5.3 MHz and alter the PWM values.  Given my requirement is to output 4 kHz PWM at 8 bit control resolution and poll for button presses at around 10 Hz , do you have any other suggestions to get the power consumption down?

  • Hi Ted,

    Unfortunately, your requirements do not allow for running the device at 60uA or less.  To achieve 8 bit resolution on a 4KHz PWM, you need ~1MHz steps.  To run a timer module with a clock that fast, you will need to either source it from an external high frequency crystal, or the internal DCO.  Either of these options will draw more than 60uA.

    You might be able to provide an external squarewave of high enough frequency as an input into the oscillator and bypass the oscillator circuitry, but we don't spec how much current that will draw, so I don't know for sure if that will meet your requirement.  Also, that will probably draw more current than 60uA and add a lot of additional cost if there is not something in the design already that can do this, making this not a viable solution.

    As with all devices, higher clock speed comes at a price of higher current.  You will need to relax either your current or you pwm accuracy requirement to make this possible.

    Mike

**Attention** This is a public forum