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.

cl430 v/s msp430-gcc

Other Parts Discussed in Thread: MSP430G2553

Hello,


I have been trying to use msp430-gcc on my ubuntu 14.04 for writing programs for msp430. But I noticed that, my sample program was behaving differently under the above two compilers. My program was to toggle LED, which is given below. The difference is with the rate of blinking which is slower in the msp430-gcc when compared to cl430. Please let me know if anything is missing here.

My Program :

#include<msp430g2553.h>

void main()

{
    WDTCTL = WDTPW + WDTHOLD;
    P1OUT  |= BIT0;
    P1DIR  |= BIT0;
    for(;;)
    {
       P1OUT ^= BIT0;
       __delay_cycles(1000000);
    }    
}


Compiler options that I Used :

CL430 :

/SNS/ti/ccsv5/tools/compiler/msp430_4.1.1/bin/cl430 filr.c -I /SNS/TI/TI_CGT_TMS470_4.6.6/include -I /SNS/ti/xdctools_3_23_03_53/packages/ti/mcu/msp430/include/ --run_linker --library /SNS/ti/xdctools_3_23_03_53/packages/ti/mcu/msp430/include/msp430g2553.cmd -l /SNS/ti/ccsv5/tools/compiler/msp430_4.1.1/lib/libc.a --output_file=myprog.out

 

MSP430-GCC :

msp430-gcc -mmcu=msp430g2553 filr.c -o myprog2.out

Thanks in Advance.

--

Regards,

VKSALIAN.

  • Are you using the old msp430-gcc from here?  That compiler is obsolete and is replaced by one released by TI from here.  I presume you use the second one, even though the command you show...

    Vijay Salian said:
    msp430-gcc -mmcu=msp430g2553 filr.c -o myprog2.out

    ... appears to use the obsolete compiler.  

    I compared the assembly generated by both compilers.  It is not identical.  One difference is that the TI compiler optimizes at level 0 by default.  The msp430-elf-gcc compiler does not optimize by default.  But I doubt that small difference contributes much to the rate of the LED blinking.

    It is much more likely some difference in system configuration or initialization is the cause.  For help with those issues I recommend you start a new thread in the MSP430 device forum.  Or, if you prefer, I can move this thread into that forum.

    Thanks and regards,

    -George