Quantcast
Channel: Forums - Recent Threads
Viewing all articles
Browse latest Browse all 262198

CCS/MSP430FR6989: LOCKLPM5 and SPI

$
0
0

Part Number:MSP430FR6989

Tool/software: Code Composer Studio

Hi,

  I'm pretty new to MSP430. I'm now trying to connect MSP430fr2355 with RFM95.

  I have already done two experiments. One is to let the whole system run in very low power. Another one controls RFM95 to send and receive data through SPI by MSP430.

  For the first one, I use the PM5CTL0 &= ~LOCKLPM5 to configure the low power pin. And it works well.

  Now I'm trying to combine two parts of the code. I add PM5CTL0 &= ~LOCKLPM5 in the send parts. But my send code does not send any data anymore. For my send part, I first put the device in sleep, and use the timer to wake it up, and send something. So after I wake up, I will use SPI which means I will change the pin status. So will PM5CTL0 &= ~LOCKLPM5 prevent me to change the pin status after I wake up from LPM3?

  Below is the main body of my code. Each function works well until I add PM5CTL0 &= ~LOCKLPM5.

------------------------------------------------

int main(void)
{
WDTCTL = WDTPW | WDTHOLD;
PM5CTL0 &= LOCKLPM5_0;
ls();//put pin to OUTPUT low
t=0; ir=0;
si();// SPI init
rfi();// RFM95 init
reg11=sr(0x11);
tb(1000);// TimerB setting 1000cycles
__bis_SR_register(LPM3_bits | GIE);
while(1){
}
}
#pragma vector = TIMER0_B0_VECTOR
__interrupt void Timer_B (void)
{
//PM5CTL0 &= LOCKLPM5_0;
ir++;
if (t<50){
ts(t); // RFM95 send data
t++;
}
reg12=sr(0x12);
}

------------------------------------------------

  If anyone can help, that's will be so great!!!


Viewing all articles
Browse latest Browse all 262198

Trending Articles