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.

MSP430 Coding Error?

Other Parts Discussed in Thread: MSP430FG439

Hi, I recently downloaded the coding for the msp430fg439 with the heart_rate and EKG display from Ti but everytime I run it, it gives me an error saying that the ADC_VECTOR is undefined. I am wondering if anyone know how to fix it? Any help will be nice.

Here is the code with the error in it

#pragma vector = ADC_VECTOR                 // ADC12 ISR
__interrupt void ADC12ISR (void)
{
Datain = ADC12MEM0; // Store converted value in Datain
__bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 on return
}// ADC12ISR

the error
Description	Resource	Path	Location	Type
#20 identifier "ADC_VECTOR" is undefined main.c /jjjj line 291 C/C++ Problem
  • What toolset and version are you using?

    I will assume since you posted in the Code Composer Studio forum that you are using CCS.  However, knowing the version is helpful.

    Try ADC12_VECTOR instead.  You should find this defined in the msp430 header file you include in the example.

  • Yea, i am using CCS version 5. I tried to do what u told me to do but it generated other errors. 


    #pragma vector = ADC12_VECTOR // ADC12 ISR
    __interrupt void ADC12ISR (void)
    {
    Datain = ADC12MEM0; // Store converted value in Datain
    __bic_SR_register_on_exit(LPM0_bits); // Exit LPM0 on return
    }// ADC12ISR
    
    
    and now the errors are
    Description	Resource	Path	Location	Type
    #10010 errors encountered during linking; "kklld.out" not built kklld C/C++ Problem
    
    
    Description	Resource	Path	Location	Type
    <a href="file:/C:/Users/tai/Desktop/ccsv5/tools/compiler/dmed/HTML/10234.html">#10234-D</a> unresolved symbols remain kklld C/C++ Problem
    Description	Resource	Path	Location	Type
    unresolved symbol mul16, first referenced in ./main.obj kklld C/C++ Problem
  • That example code was written for IAR Embedded Workbench and not CCS. If you take a look at the application note that comes with the example, it states this along with the fact that both the C source file and mul.s43 assembly source file needed to be added to the project. If you have IAR Kickstart edition, you should be able to build and run the code without modifications.

    To make it work with CCS though, you would first need to add mul.s43 to the project ( to resolve the unresolved symbol error you are seeing). Then you will likely need to make some slight changes to the file to make it build with CCS (as assembler directives are different between the IAR and CCS assemblers). Appendix C of this Users Guide should help with that migration.

  • Thanks for the help so far, so I downloaded the IAR Embedded Workbench IDE from TI and tried to run the code but now I am getting a different error saying that

    Error[2]: Failed to open #include file 'math.h' C:\Users\tai\Documents\asm.s43 68 
    Error while running Assembler 
    I am wondering if you guys would know how to fix it? Thanks for your help
    is it because I dont have math.h on my computer and thats why it didn't work?
  • math.h is typically included with the compiler toolset, so should be located somewhere within the compiler folder inside your IAR installation (usuallly in a \include sub-folder). Within your project options, there should be a place to set compiler include paths (paths where the compiler should look for include files) and that needs to list the path to where math.h resides. Most IDE's would set up the path to the compiler include files automatically but please check this to be sure. 

  • Thanks for all the help so far but I am encountering problems after problems. The math.h was fixed but now I have a different problem. When I tried to debug the Heart Rtae with EKG code, it would run with no error but when the simulator window came up, it didn't seem like it simulated since my computer made a weird sound that sounded like there was an error in it. Does anyone know what is going on and how to fix it?

    This is what showed up on the asm after debugging

    #include "msp430.h"                     ; #define controlled include file

    NAME main ; module name

    PUBLIC main ; make the main label vissible
    ; outside this module
    ORG 0FFFEh
    DC16 init ; set reset vector to 'init' label

    RSEG CSTACK ; pre-declaration of segment
    RSEG CODE ; place program in 'CODE' segment

    init: MOV #SFE(CSTACK), SP ; set up stack

    main: NOP ; main program
    MOV.W #WDTPW+WDTHOLD,&WDTCTL ; Stop watchdog timer
    JMP $ ; jump to current location '$'
    ; (endless loop)
    END
  • Tai,

    Since it looks like you are now using the IAR toolset and not CCS please post your question to the MSP430 device forum as the folks watching that forum have more expertise both with the toolset as well as the specific example you are working with. We tried to help with the initial general questions you had but cannot help too much with specific IAR debugging questions.

  • Hello...

    I'm facing exactly the same problem as above,I added the mul.s43 file but I have no clue about the CHANGES you are saying to make in the file to get it easily build with ccs.I went through the user guide link you have given but I could hardly help myself.

    Could you specifically mention the relevant topic to be seen in that user guide you mentioned as it seem to contain a lot of information.