Quantcast
Channel: MSP430 Technical Forums
Viewing all articles
Browse latest Browse all 2077

MSP430FR5969 refuses to go to sleep. Code works on G2553

$
0
0

I just got myself a FR5969, so far I'm really enjoying it.

I got the RTC going, very entertaining.

I got RTC interrupts going, also very entertaining.

Now I'm working on sleep mode, I want to use the RTC interrupts to wake up from sleep mode every once in a while, then sleep in LPM3 (or one of the LPMx.5 modes, eventually).

 

I spent longer than I'm willing to admit reading the FR5969 datasheet and setting registers, eventually ending up in assembly. It will not sleep.

Here is the basic test code I'm using right now:

 

int counter;
void setup()
{
  // put your setup code here, to run once:
  pinMode(RED_LED,OUTPUT);
  digitalWrite(RED_LED,LOW);
  pinMode(GREEN_LED,OUTPUT);
  digitalWrite(GREEN_LED,LOW);
  pinMode(PUSH1,INPUT_PULLUP);
  delay(1);
  attachInterrupt(PUSH1,wakeUp,FALLING);
}

void loop()
{
counter++;
if (counter > 20000){
  digitalWrite(RED_LED,HIGH);
}
LPM4;
digitalWrite(GREEN_LED,HIGH);
 
}


void wakeUp(){
  digitalWrite(RED_LED,HIGH);
  delayMicroseconds(10000);
  digitalWrite(RED_LED,LOW);
}

 

On a G2553 (with the "PUSH1"'s changed to "P1_3", of course) this results in the LEDs starting turned off, and staying that way indefinitely.

If you push the button, the red LED comes on briefly, then goes off and the green LED comes on and stays on.

Further button presses result in more red LED flashes, eventually turning it on solidly when the counter gets high enough.

 

On the FR5969 the green LED comes on immediately on powerup, and the red LED comes on somewhere around 500-700ms later.

If I comment out LPM4; the red LED comes on much sooner, maybe 200-300ms.

Calling LPM4 is doing something, but what it is doing I have no idea.

I would dearly like to get this to work, very low power sleep being half the reason I bought this thing! (Low power awake being most of the other half)

 

The one thing I can think of that I have no done is try this in CCS. I rather like Energia and CCS has confused me so far, I'd rather use Energia if possible.

 

 

Has anybody else gotten LPM modes to work on this thing?


Viewing all articles
Browse latest Browse all 2077

Trending Articles