Part Number: MSP430FR2153
Tool/software: Code Composer Studio
Hi,
I am struggling with LPM4 wakeup. There are two sources which will wakeup the processor: button press and UART data. Button press wakes up my MSP most times - but not always. And UART does never. I cannot the the reason why. Here are some code snippets (I am really sorry, but code highlighter seems not to work for me):
within main loop:
while(1)
{
static uint16_t count = MAIN_SLEEP_TIMEOUT_MS;
WAIT_MILLISECONDS(1);
if(signal_anySignalsSet() == false)
{
if(--count == 0)
{
count = MAIN_SLEEP_TIMEOUT_MS;
bluetooth_sleepUART();
__bis_SR_register(LPM4_bits | GIE); // Enter LPM4, interrupts enabled
__no_operation();
}
}
if(semaphore_check(SEMAPHORE_UART_LINE) == true)
{
}
}
within UART interrupt:
if(rxByte == CR)
{
semaphore_send(SEMAPHORE_UART_LINE);
bic_SR_register_on_exit(LPM4_bits);
}
within button interrupts:
if(stor_ifg & BUTTON1_FALLING) // Button is pushed
{
// debounce
WAIT_MILLISECONDS(5);
if((P1IN & BUTTON1_FALLING) == 0) // has to stay 0
{
signal_send(SIGNAL_BUTTON_PRESSED);
DEBUG_PIN1_TGL();
//__bic_SR_register_on_exit(LPM4_bits);
__no_operation();
}
} // button falling
I am pressing the buttons 3 or more times and suddenly a press or release does not execute a wakeup!!!