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.

MSP430FR2433: "Wake-up function"

Part Number: MSP430FR2433
Other Parts Discussed in Thread: MSP430FR2000

Hi Team, seeking some inputs for a customer. 

working with a TI microcontroller called msp430fr2433. I need a code, to be integrated with my own code, in order to run my code only once and hour. Basically I would need a “wake up” function, to turn on the microcontroller from a low power mode only through a long delay.
At the moment my code is not even needed, it can easily substitute the line of code about LED on/off and eventually, only when we know that the “long delay wake up function” works, we can substitute the line “led on off” with my actual code.
This microcontroller has different timers and different low power modes. I found many codes that call an interrupt function from within the main code which work. The problem is that these codes have a delay of max a second. I therefore understood that it’s possible to integrate to this type of code a software counter to make the delay longer. I would like to know if you think you can help me with this and if so, I would love to jump on a call asap to discuss further. Thank you very much in advance for letting me know

Thius example has the main code that puts the microcontroller in the low power mode (LPM0 in these case) and calls the interrupt function outside of main code which, when it runs, wakes the microcontroller up and executes the actual code (in these examples simply turning on the LED for demonstration purposes, which eventually I would like to substitute with my actual code).
https://dev.ti.com/tirex/explore/node?node=A__ANeJ8ixtppj0XK4f9yuyKw__msp430ware__IOGqZri__LATEST

The problem with this two code is that I can't delay further the sleep mode (LPM), in both cases the delay is short and can't elongated much. For this reason I think that the solution would be to integrate to this code, a software counter such as the one in the attached code (which unfortunately has been developed for another microcontroller MSP430FR2000). But I did try to adjust and integrate, unsuccessfully.

Thank you.

-Mark

  • Hi Mark,

    If I'm understanding this, you want a timer that will wake up another MCU via a GPIO toggle. An idea is setting up a timer to count then when the timer does an overflow you increment another variable. Once the variable is a certain amount you can toggle the GPIO. For example.

    #include <msp430.h>
    int count;
    int main(void)
    {
        WDTCTL = WDTPW | WDTHOLD;                 // Stop WDT
        
        // Configure GPIO
        P1DIR |= BIT0;                            // Set Pin as output
        P1OUT |= BIT0;
        
        // Disable the GPIO power-on default high-impedance mode to activate
        // previously configured port settings
        PM5CTL0 &= ~LOCKLPM5;
        
        // Timer1_A3 setup
        TA1CCTL0 = CCIE;                          // TACCR0 interrupt enabled
        TA1CCR0 = 50000;
        TA1CTL = TASSEL_1 | MC_2;                 // ACLK, continuous mode
        count = 0;
        __bis_SR_register(LPM3_bits | GIE);       // Enter LPM3 w/ interrupt
    }
    
    // Timer A1 interrupt service routine
    #if defined(__TI_COMPILER_VERSION__) || defined(__IAR_SYSTEMS_ICC__)
    #pragma vector = TIMER1_A0_VECTOR
    __interrupt void Timer1_A0_ISR(void)
    #elif defined(__GNUC__)
    void __attribute__ ((interrupt(TIMER1_A0_VECTOR))) Timer1_A0_ISR (void)
    #else
    #error Compiler not supported!
    #endif
    {
        count++;
        if(count > 20){
            P1OUT ^= BIT0;
            count = 0;
            }
        TA1CCR0 += 50000;                         // Add Offset to TA1CCR0
    }
    

    The math would be (Timer CCR0 value) * (1/(Clock Frequency)) * Count = Time between toggle.

    Adapted from MSP430FR24xx Demo - Timer1_A3, Toggle P1.0, CCR0 Cont Mode ISR, 32KHz ACLK

    Another example would be to use the RTC. See this example MSP430FR243x Demo - RTC, toggle P1.0 every 1s 

    Regards,

    Luke

**Attention** This is a public forum