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.

MSP430G2553: Assembly Program in msp430g2553

Part Number: MSP430G2553
Other Parts Discussed in Thread: MSP430G2231

Hello everyone,

I am trying assembly language programming in msp430g2553. The code is given below:-

.cdecls C,LIST,"msp430g2231.h"
RESET mov.w #0280h,SP
StopWDT mov.w #WDTPW+WDTHOLD,&WDTCTL

SetupP1 mov.b #001h,&P1DIR
mov.b #000h,&P1OUT
bis.b #008h,&P1REN
bis.b #008h,&P1IE
bis.b #008h,&P1IES
bis.b #008h,&P1IFG

Mainloop bis.w #GIE,SR
nop

P1_ISR;
xor.b #001h,&P1OUT

bic.b #008h,&P1IFG
reti


.sect ".reset"
.short RESET
.sect ".int02"
.short P1_ISR
.end

But I am getting a problem always in the Console Window which is as under:-

**** Build of configuration Debug for project weropisf ****

"C:\\ti\\ccsv6\\utils\\bin\\gmake" -k all
'Building file: ../led.asm'
'Invoking: MSP430 Compiler'
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/bin/cl430" -vmsp --abi=eabi --data_model=small --code_model=small --use_hw_mpy=none --include_path="C:/ti/ccsv6/ccs_base/msp430/include" --include_path="C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include" --advice:power=all -g --define=__MSP430G2553__ --diag_warning=225 --diag_wrap=off --display_error_number --printf_support=minimal --preproc_with_compile --preproc_dependency="led.pp" "../led.asm"
'Finished building: ../led.asm'
' '
'Building target: weropisf.out'
'Invoking: MSP430 Linker'
"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/bin/cl430" -vmsp --abi=eabi --data_model=small --code_model=small --use_hw_mpy=none --advice:power=all -g --define=__MSP430G2553__ --diag_warning=225 --diag_wrap=off --display_error_number --printf_support=minimal -z -m"weropisf.map" --heap_size=0 --stack_size=0 -i"C:/ti/ccsv6/ccs_base/msp430/include" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/lib" -i"C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/include" --reread_libs --warn_sections --diag_wrap=off --display_error_number --xml_link_info="weropisf_linkInfo.xml" --use_hw_mpy=none --entry_point=RESET -o "weropisf.out" "./led.obj" "../lnk_msp430g2553.cmd" -l"rts430.lib"
<Linking>
fatal error #16000: object files have incompatible formats ("C:/ti/ccsv6/tools/compiler/ti-cgt-msp430_4.4.5/lib/rts430.lib<int00.obj>" = TI-COFF, "./led.obj" = ELF)

>> Compilation failure
gmake: *** [weropisf.out] Error 1
gmake: Target `all' not remade because of errors.

**** Build Finished ****

Please help me in resolving this.

  • By mistake I have put msp430g2231.h in .cdecls C,LIST,"msp430g2231.h".But after changing it with msp430g2553.h still the problem remains the same.So sir please help me in resolving this problem.
  • I had no issues with the following, CCS v6.2 and TI v16.9.2.LTS.  Make sure that you are using eabi (ELF) output format under Project Properties -> General.

    ;-------------------------------------------------------------------------------
                .cdecls C,LIST,"msp430g2553.h"       ; Include device header file
    
    ;-------------------------------------------------------------------------------
                .def    RESET                   ; Export program entry-point to
                                                ; make it known to linker.
    ;-------------------------------------------------------------------------------
                .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.w   #__STACK_END,SP         ; Initialize stackpointer
    StopWDT     mov.w   #WDTPW|WDTHOLD,&WDTCTL  ; Stop watchdog timer
    
    
    ;-------------------------------------------------------------------------------
    ; Main loop here
    ;-------------------------------------------------------------------------------
    
    			mov.b #000h,&P1OUT
    			bis.b #008h,&P1REN
    			bis.b #008h,&P1IE
    			bis.b #008h,&P1IES
    			bis.b #008h,&P1IFG
    
    Mainloop 	bis.w #GIE,SR
    			nop
    
    P1_ISR;
    			xor.b #001h,&P1OUT
    
    			bic.b #008h,&P1IFG
    			reti
    
    
    ;-------------------------------------------------------------------------------
    ; Stack Pointer definition
    ;-------------------------------------------------------------------------------
                .global __STACK_END
                .sect   .stack
    
    ;-------------------------------------------------------------------------------
    ; Interrupt Vectors
    ;-------------------------------------------------------------------------------
                .sect   ".reset"                ; MSP430 RESET Vector
                .short  RESET
    
                .sect ".int02"
    			.short P1_ISR
    			.end

    Regards, Ryan

**Attention** This is a public forum