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.

Questions Regarding Programming the MSP430F5637

Other Parts Discussed in Thread: MSP430WARE, MSP430F5637, MSP430F169

I would like to program the MSP430F5637 using Code Composer Studio and take advantage of MSP430Ware and the driver libraries available. However, I am new to these tools and do not understand them very well. In particular, I would like to use some code from the driver libraries to run some SPI and UART communication. First, I would like to find this code and look at it to understand what it going on. Then I would like to drop it into my current project. Can I just make a function call or an include statement to driver in question?

Additionally, I would like to find the header file that is usually included the main function using a statement such as "#include<msp430f5637>." Where does this code reside? Is it already a part of the MSP430ware? How do I find it and how do I make sure it is included in my project?

Any resources that would answer this type of programming questions would be greatly appreciated. Even a code example for CCS using msp430ware for the msp430f5637 would go a long way to answering these questions.

Thanks very much for any help you might offer.

Sincerely,

JK

  • James Kerwin said:
    Can I just make a function call or an include statement to driver in question?

    Both. And more.

    You'll need to add the library file (if precompiled) or library source code (if provided as C files) to the project, then you'll need to include the library header file into each of your own code files where you want to use the library, then you have to make funciton calls to use the actual library functions.

    However, some libraries are designed so that you directly include the source code files into your (one and only, in this case) code file as if your wrote all the library code directly in there.

    I strongly dislike this kind of 'library' practice as it makes larger projects quite impossible. However, some of the TI 'libraries' use this ugly and error-prone method. But if the library has been created this way, you'll either have to write your own header files to turn it into an external code block, or you'll have to live with it. A documentation on how to use this specific 'library' should be included with the souce then.

    James Kerwin said:
    Additionally, I would like to find the header file that is usually included the main function using a statement such as "#include<msp430f5637>."

    This type of inlcude files contains no code. It contains the declarations for the particular MSPs hardware registers as well as interrupt vector definitions and such stuff. It is highly device-specific and must match the MSP you're using (or else your code will compile but likely won't work)
    However, you'll still have to set the target MSP typ in teh project settings, so the compiler and linker know what to do.

  • Thank you very much for your reply. That answers some part of my questions, but my questions really pertain to the specific MSP430ware structure and how to use it. I have not been able to find any documentation that would walk me through the process. There is an empty project in the MSP430ware, which has all of the pathing associated with the driver libraries, but this project will not have the correct target device chosen. I would like to create my own project, which will allow me to choose the MSP430F5637 as the target device and still preserve the pathing associated with the MSP430ware directory structure. 

    As to the header file, I would like to be able to look at all of the variable declarations, so that I might reference them correctly. In addition, I want to know where this code is. Is it in CCS? How do I find it specifically?

  • Additionally, at the following link I have been able to find two links to the MSP430ware Peripheral User's Guide and the API Guide. However, neither of these sources explain how to setup your own project in any more detail than what I already know about the empty project. 

    http://software-dl.ti.com/msp430/msp430_public_sw/mcu/msp430/MSP430ware/latest/index_FDS.html

    Also, at the bottom of the page, above the user's guide there is a section that provides a download for the legacy header files, but why have they become a legacy? Are they already included in CCSv5.1? Where are they and how are they compiled into the project if you do not need them in the newer CCS versions?

  • James Kerwin said:
    download for the legacy header files, but why have they become a legacy

    Originally, there have been header files for a group of devices. When this was introduced, a group of devices (such as MSP430F16x) was identical except for the size of ram/flash. So one header file did fit all. Usually, tehre was one header file for one device detasheet and all devices covered within.

    However, newer device groups have hardware differences other than the amount of memory. with or without ADC, two or four USCIs etc. And the 'letter' in the name is no longer jsut 'f' for flash and 'c' for rom based, btu also 'g' for value line, 'fr' for fram device, then 'AFE' or 'fe,'fg' etc. So the simple 'x' in the name was misleading too. (does msp430x24x.h apply to G2412/G2413/G2432 etc. as well as to F3471 or F2410? It doesn't!
    The naming has gotten very complicated. Why is one header file for 5418, 5435 and 5437, but not for 5419, 5436 and 5438?
    So TI has switched to providing one header file for each individual device. Even if this means that several files are 100% identical.
    Instead of having one msp430x16x.h file, there now is an msp430f169.h, f1610.h etc.

    However, old code uses the old files, so they are provided for the newer compiler versions that use the individual header now.

  • Thank you very much for your reply, but you still have not answered my questions.

    What should I include in my project? Which header file am I supposed to use? How do I put it there?

  • James Kerwin said:
    Thank you very much for your reply, but you still have not answered my questions.
    What should I include in my project? Which header file am I supposed to use? How do I put it there?

    I thought I did - sort of. I don' t know this particular library so I cannot give you a specific answer to this part. I gave you more general hints instead, so you might be able to figure out yourself, for this or other ones.

    Abotu the how, well, the #include "filename" preprocessor instruction ioncludes the files that are directly (literally) inserted into your existing code. Either header files for external code, or the library code itself. For source file that are to be compiled separately, these have to be added to the project (project options ->source or something like that)

**Attention** This is a public forum