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.

MSP430F5359: Power Consumption Using external clock

Part Number: MSP430F5359
Other Parts Discussed in Thread: MSP430F5436,

I'm having an issue that I can't seem to get past: Once the external crystal is enabled, I burn about 230mW (about 70mA at 3.3V) in LPM4 mode. I've got a similar processor (MSP430F5436) on the same board and it draws around 2mW in LPM4. 

Here are the details:

1) The board only has a handful of bypass caps, the two CPUs, and two 7.37MHz crystals (one for each). 

2) The code for the processors are basically the same:

int main(void) {
volatile unsigned int i;

WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer

Use_XT2();

__bis_SR_register(LPM4_bits ); // Enter LPM4, interrupts disabled ............Temp!!!!!!!!

...however the "Use_XT2" routines are different as they are specific to each processor type. 

For the MSP430F5359 (the one that is drawing excessive power) the "Use_XT2" code is:

void Use_XT2 (void)
{
volatile unsigned int i;

PDSEL_L = 0x0C;

// setup clock using 7.3728mhz xtal on xt2
UCSCTL0 = 0x0000; // DCO set by hardware when using FLL

UCSCTL1 = 0x0060; // DCORSEL = 6 with Selects DCO freq range 4.6 - 10.7 MHz

UCSCTL2 = 0x0001; // FLLD = 0, FLLN = 1,

UCSCTL3 = 0x0050; // FLLREFCLK = 5 (select XT2CLK)
// FLLREFDIV = 0 (Ref /1)

UCSCTL4 = 0x0555; // ACLK = MCLK = SMCLK = XT2CLK


UCSCTL5 = 0x00; // ACLK, MCLK, SMCLK all div by 1 for now

// __bis_SR_register(LPM4_bits ); // Enter LPM4, interrupts disabled ............Temp!!!!!!!!

UCSCTL6 = 0x002D; // XT2DRIVE = 0, 4 to 8mhz
                                   // XT2BYPASS = 0, for xt2 operation
                                   // XT2OFF = 0, XT2 is ON
                                  // XT1DRIVE = 0
                                  // XTS = 1, hi freq caps not used
                                   // XT1BYPASS = 0
                                 // XCAP = 3, smallest value
                                 // SMCLKOFF = 0, SMCLK is on
                                 // XT1OFF = 1, xt1 is off

__bis_SR_register(LPM4_bits ); // Enter LPM4, interrupts disabled ............Temp!!!!!!!!


} // USe_XT2()

Note the LPM4 mode statements. In the current configuration, the power draw is 240mW. If I remove the comments from the one above where UCSCTL6 get set, then the power drops to 2mW. Basically I'm stopping the CPU right before the XT2 crystal is enabled. 

3) I've looked at the crystal pins for both CPUs and they look identical.

What am I missing?

Thanks in advance!!

  • Why are you mentioning an "external clock" when you are not using the bypass mode?

    Anyway, this is not the proper way to initialize the crystal oscillator. You have to wait until its startup has finished; see the example programs for details.

    And you will waste a random amount of power if you do not initialize the unconnected pins properly (see section 1.6 of the User's Guide).
  • Thanks so much for the quick response!

    My apologies - I did use the term clock rather than crystal. I'm using an external crystal so I think I've got it set up correctly for that. XT1 is in bypass mode as bit zero of UCSCTL6 is set and XT2 is on as Bit 8 is 0. Bit 12 is cleared so I'm selecting the external crystal.

    I'd actually had an "initDiscreteIO" routine which sets up all of the direction, function, and output settings for each port prior to calling the "Use_XT2" routine. I'd just taken that out in an attempt to narrow down the issue. Moving it back where it was has no affect - the power is still rather high. Good point, though.

    I should also mention that I did pull out the routine which checks the OSC fault flags. Is that what you are referring to? Here's the code:

    while(SFRIFG1 & OFIFG) { // Check OFIFG fault flag
       while ( (SFRIFG1 & OFIFG)) // Check OFIFG fault flag
       {
          // Clear OSC fault flags
          UCSCTL7 &= ~(DCOFFG + XT1LFOFFG + XT1HFOFFG + XT2OFFG);
          SFRIFG1 &= ~OFIFG; // Clear OFIFG fault flag
       }
    }

    I put that back into the "Use_XT2" routine. It does clear that routine - I can set an LED after the routine and it turns on. I'm guessing that since there are no faults that the processor things the oscillator is working properly?

    I should also note that I unplug the emulator from the board and power cycle on each check. Leaving it plugged in gives unpredictable results as I'm not sure what on the emulator is pulling power.

    After the restoration of the oscillator check loop and the "initDiscreteIO" routine, I still am pulling 240mW.

    Thanks again so much for the help.

    Rich

  • No, XT1 is not in bypass mode.

    Why are you clearing XT2OFF?

    What is the configuration of the XT2 pins?

    Is there anything connected to any of the pins?
  • Thanks so much for the response. Good questions.

    Maybe I'm reading the datasheet incorrectly, but I thought I was putting XT1 in bypass mode. SLAU2080 (MSP430x5xx and MSP430x6xx Family User's Guide on pages 181 & 182 shows that XT1 is turned off when bit zero is set in the UCSCTL6 register. I'm setting that register to 0x002D, so that should be set. Similarly bit 8 is normally set and thus turns off XT2. I'm clearing it to turn on XT2. Or at least I think that's what I need to do. Am I wrong there?

    The XT2 pins on this processor are on the P7.2 and P7.3 pins, so those pins are put into 'Peripheral function' mode by setting this the P7SEL register to 0x0C. That was done in the first line of the 'Use_XT2' routine.

    As for the rest of the pins, I've made sure there is no other hardware on the board - not even any pullups. It's just the CPUs, their crystals, a bunch of bypass caps, and a 5.0 to 3.3V regulator (the regulator has no I/O connections to either CPU). The only I/O that are connected are the two pins (8.2 & 8.3) for the UCA1 connection between the CPUs. I've played with setting those pins as inputs or as outputs (both high or low) and have seen no change in the power draw.

    Thanks!

    Rich
  • Bit 0 is called XT1OFF. XT1BYPASS would be bit 4.

    The XT2OFF bit (like XT1OFF) turns off XT2 only if it is not actually needed. Clearing it forces XT2 to run even in LPM4.

    The XT2DRIVE bits should keep their largest value during startup; reduce them only when the crystal is running.

    XTS enables the high-frequency mode of XT1, which you hardware does not have. Don't ever set it.

    Try setting UCSCTL6 to XT1OFF+XCAP_3+XT1DRIVE_3+XT2OFF+XT2DRIVE_3.

  • Yea!! That did it. It was still high with that setting, however when I set the XT2 drive down to 0 (rec for 4 to 8 MHz) it worked. Now hovering around 3mW. I'd missed that about the XTxOFF bits - great call.

    Thanks so much!

    Rich

**Attention** This is a public forum