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.

MSP430FR5994: MSP430 Power Up time from cold start

Part Number: MSP430FR5994
Other Parts Discussed in Thread: MSP-EXP430FR5994

Hello All,

I am currently evaluating the MSP430FR5994 chip for use and need to verify power up time from a cold start.  Per the data sheet, it specifies that nominal is .5ms, and max is 1ms (data sheet, section 5.12.4).  My tests show differently and was wondering if any know a way to test to get such results.  (not sure I can change the clock source prior to my GPIO pin going high, that is about the 3rd line in my test app)

My setup is as follows:

  1. using the LauncPad Dev board MSP-EXP430FR5994
  2. Using the bare bones "BlinkLed" project, modify it to init a specific GPIO on start and drive high
  3. Using an oscilloscope, connect probes to this pin, the 3.3v supply, and RST pin on the dev board
  4. Trigger scope by either
    1. Power up the board, triggering the scope on the rising edge of the GPIO.
    2. Leave board powered, press reset button

(basically, on cold start, 3.3 and RST go HIGH at the same time)

In both 4.a and 4.b, the time from RST high or 3.3 High to the GPIO High is about 1.7ms.  Our application requires very fast wake-up times, and saving a ms will help a lot..

Thanks,

-mike

Code Snippet:

int main(void) {

    volatile uint32_t i;

    // Stop watchdog timer
    WDT_A_hold(WDT_A_BASE);

    // Set P4.4 to output direction
    GPIO_setAsOutputPin(
       GPIO_PORT_P4,
       GPIO_PIN4
       );

    GPIO_setOutputLowOnPin(GPIO_PORT_P4,GPIO_PIN4); //init to 0

    GPIO_setOutputHighOnPin(GPIO_PORT_P4,GPIO_PIN4);//drive high - oscilloscope trigger

    // Board initialization
    Init_GPIO();

    GPIO_setOutputHighOnPin(GPIO_PORT_P4,GPIO_PIN4); //drive high again, init gpio will reset to low

    FRAMCtl_A_configureWaitStateControl(FRAMCTL_A_ACCESS_TIME_CYCLES_1);
    Init_Clock();  //16MHz DCO

    // Set P1.0 to output direction
    GPIO_setAsOutputPin(
        GPIO_PORT_P1,
        GPIO_PIN0
        );

    // Set P1.0 to output direction
    GPIO_setAsOutputPin(
        GPIO_PORT_P4,
        GPIO_PIN4
        );

    // Disable the GPIO power-on default high-impedance mode
    // to activate previously configured port settings
    //PMM_unlockLPM5();

    while(1)
    {
        // Toggle P1.0 output
        GPIO_toggleOutputOnPin(
            GPIO_PORT_P1,
			GPIO_PIN0
			);

        //GPIO_toggleOutputOnPin(
        //            GPIO_PORT_P4,
        //            GPIO_PIN4
        //            );

        // Delay
        for(i=1000000; i>0; i--);
    }
}

  • Hello Mike,
    I will perform some test on my side, but my initial feedback is the following:
    As visible from your code, you're using the Driver Lib functionality. In this case you have to keep in mind the impact on code execution time, code size and impact on current consumption. Using the Library is of course sort of comfortable for code generation, but it come not for free. The code is significantly larger, even for simple things like toggling a pin. Thus it consumes more memory, more current and more time.
    The second thing is the coding in C. Both library and code in C means, in addition to the device internal boot code, which is executed on startup, and cannot be avoided, also a startup code is being inserted and executed. This happens before the code in the main.c file. This is the case with all C coded projects. The complexity of the given project tends to increase the C-Startup code, and thus it is to be expected, that using the Driver Lib does too. It is possible to modify manually the C-Startup, to include critical code as soon as possible. Definitely assembler based code is the fastest option with the given device.
    Just as a side note. MSP430 devices without power management on chip, these are F1xx, F4xx, F2xx and G2xx definitely starting significantly faster, as no internal boot code is being executed on POR.
    I come back to you soon on the test results on my side.

    Best regards
    Peter
  • Hello Peter,

    Thanks for the reply.  As you suggested, I dug more into the sample code given and did see that the GPIO initialization for a single port was taking quite a few cycles.  I also found that due to this, the clearing of the PMM bit was delaying all my startup, thus delaying my initial GPIO High setting.  Bu removing most of the driver lib functionality, and moving the PMM bit clearing earlier in the snippet, I am able to get the power up time to around 580us (which is good for our application, and I am guessing we can shrink that with removing the remaining driver code, or assembly).  But as you mentioned as well, we will probably have to do some modification of the C init routines to get all that we need initialized in a timely manner.  Thanks a bunch for pointing me in the right direction.  I must admit this chipset is worlds different from our previous project (C2000 series DSP). 

    Thanks, again.

    -mike

  • Hello Mike,

    many thanks for your feedback. I have performed some simple tests  with the FR5994 Launchpad and assembler based code.

    One measurement was with releasing the RST.

    The 2nd one is with power up and toggle of P1.0.

    Please keep in mind, this based just on one sample, and can just be used as indicator, what would be achievable with shortest possible code.

    Please see the used assembler code below:

    ;------------------------------------------------------------------------------
    ; MSP430 Assembler Code Template for use with TI Code Composer Studio
    ;
    ;
    ;
    ;  written by: Peter Spevak
    ;
    ;  last change: January 15th 2019
    ;
    ;  01/15/2019 setting up the project
    ;------------------------------------------------------------------------------
                .cdecls C,LIST,"msp430.h"       ; Include device header file
               
    ;------------------------------------------------------------------------------
                .def    RESET                   ; Export program entry-point to
                                                ; make it known to linker.
    ;******************************************************************************
    ; Stack Pointer definition
    ;******************************************************************************
                .global __STACK_END
                .sect   .stack

    ;------------------------------------------------------------------------------

                .text                           ; Assemble into program memory.
                .retain                         ; Override ELF conditional linking
                                                ; and retain current section.
                .retainrefs                     ; And retain any sections that have
                                                ; references to current section.

    ;-------------------------------------------------------------------------------

    RESET
           MOV     #__STACK_END,SP              ; Initialize stackpointer
    StopWDT
           MOV     #WDTPW|WDTHOLD,&WDTCTL       ; Stop watchdog timer

           BIC.B   #BIT0,&P1OUT                 ; set P1.0 to low
           MOV.B   #BIT0,&P1DIR                 ; switch P1.0 to output direction

           BIC     #LOCKLPM5,&PM5CTL0           ; Disable the GPIO power-on default
                                                ; high-impedance mode to activate
                                                ; previously configured port
                                                ; settings

           XOR.B   #BIT0,&P1OUT                 ; toggle P1.0

    ;******************************************************************************
    ; Main loop
    ;
    ; @brief: main loop
    ;
    ; last change: September 4th 2018
    ;
    ; 09/04/2018 setting up the function
    ;******************************************************************************
    main
           NOP
           BIS     #LPM0 + GIE,SR               ; Enter LPM0 w/ interrupt
           NOP                                  ; For debugger
           JMP     main                         ;
           NOP


    ;******************************************************************************
    ; Interrupt Vectors
    ;
    ; last change: September 4th 2018
    ;
    ;******************************************************************************
           .sect   ".reset"                ; MSP430 RESET Vector               0FFFEh
           .short  RESET

    Best regards

    Peter

    ;------------------------------------------------------------------------------
    ; MSP430 Assembler Code Template for use with TI Code Composer Studio
    ;
    ;
    ;
    ;  written by: Peter Spevak
    ;
    ;  last change: January 15th 2019
    ;
    ;  01/15/2019 setting up the project
    ;------------------------------------------------------------------------------
                .cdecls C,LIST,"msp430.h"       ; Include device header file
                
    ;------------------------------------------------------------------------------
                .def    RESET                   ; Export program entry-point to
                                                ; make it known to linker.
    ;******************************************************************************
    ; Stack Pointer definition
    ;******************************************************************************
                .global __STACK_END
                .sect   .stack

    ;------------------------------------------------------------------------------

                .text                           ; Assemble into program memory.
                .retain                         ; Override ELF conditional linking
                                                ; and retain current section.
                .retainrefs                     ; And retain any sections that have
                                                ; references to current section.

    ;-------------------------------------------------------------------------------

    RESET
           MOV     #__STACK_END,SP              ; Initialize stackpointer
    StopWDT
           MOV     #WDTPW|WDTHOLD,&WDTCTL       ; Stop watchdog timer

           BIC.B   #BIT0,&P1OUT                 ; set P1.0 to low
           MOV.B   #BIT0,&P1DIR                 ; switch P1.0 to output direction

           BIC     #LOCKLPM5,&PM5CTL0           ; Disable the GPIO power-on default
                                                ; high-impedance mode to activate
                                                ; previously configured port
                                                ; settings

           XOR.B   #BIT0,&P1OUT                 ; toggle P1.0

    ;******************************************************************************
    ; Main loop
    ;
    ; @brief: main loop
    ;
    ; last change: September 4th 2018
    ;
    ; 09/04/2018 setting up the function
    ;******************************************************************************
    main
           NOP
           BIS     #LPM0 + GIE,SR               ; Enter LPM0 w/ interrupt
           NOP                                  ; For debugger
           JMP     main                         ;
           NOP


    ;******************************************************************************
    ; Interrupt Vectors
    ;
    ; last change: September 4th 2018
    ;
    ;******************************************************************************
           .sect   ".reset"                ; MSP430 RESET Vector               0FFFEh
           .short  RESET

**Attention** This is a public forum