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.

Header file import in Code Composer Studio from IAR

Hi Everyone!

 

I am a newbie on the MCU world and have recently been facing some problems with header files. The book I am using to teach myself has codes written for the IAR kickstart IDE whereas I am using CCS v4.

Certain header files like the io430.h is not there in CCS, which carries msp430.h instead. However, the CCS compiler does recognize certain "user friendly and readable" codes like-- TACTL_bit. TAIF, and I have to use masking, which gets tedious.

Therefore, I was wondering whether I can import the io430.h header into my project in CCS. If yes, how? Also, will importing io430.h and #include -ing with msp430.h cause any conflicts?

On a general note, is there any internet website from where one can get header files?

 

Thanks,

UE

  • Upol Ehs said:
    I was wondering whether I can import the io430.h header into my project in CCS

    No. Besides the 'user friendly defines', there are many otehr defines which are compiler specific and won't work on CCS.
    You'll get a lot of errors when you try to include both, and things won't probably work if you only include the 'foreign' one.

    Also, those friendly defines are not following any standard, so using them makes your code less portable. On othe rcompilers they may be different (or not there, as you encountered). It is, however, possible that the original headers also include those defines, yet with different names.
    But I know what you mean about 'readability'. And it indeed makes life easier - at first.
    However, the very moment you have to debug the code and need to know what this 'readable' define really means (to compare it with the register descriptions), you end up scanning the header files for the real value of these defines.
    Also, I've seen a significant number of bugs based on the unnoticed misuse of these convenience defies. (e.g. ANDing a bit pattern to a register without clearing the previous content before, or comparing a constant with 0 instead or masking a register with the constant and then checking)

    i fyou really still want them, you can copy them from the IAR includes and add them to a separate headre file you include in your project folder and code files. Then you're on the safe side.

**Attention** This is a public forum