Writing MSP430 C Code
To make programming easier for you, CCS automatically adds these two device-specific files to
your project.
• You’ll find a linker command file added to your project folder; in fact, it should be listed in the
Project Explorer window within your project.
• Most new CCS projects include an “empty” main.c file. The header file is #included at the
top of this file.
Device Specific Files (.h/.cmd)
New CCS projects automatically contain two files based upon the
“Target CPU” selection:
1. Device header file ( msp430f5529.h )
Symbols defined for bit fields, reg’s, etc.
Structs/union’s also defined for bit fields, if you prefer
You shouldn’t have to use hard-coded bit locations, etc.
Your code should #include msp430.h, this points to the device specific .h file
2. Device linker command file ( msp430f5529.cmd)
Device specific addresses defined in dev specific .cmd file
Creating a new CCS project automatically includes a project .cmd file … which includes
the device specific .cmd file
You shouldn’t have to ever look up the address of a register
Default linker command file in your project points to device specific .cmd file
You should use these symbols in your code, rather than specifying
hard values/addresses
MSP430ware also uses these symbolic definitions; that is, these
definitions represent the lowest-level abstraction layer for C code
In the next chapter we introduce the MSP430ware Driver Library. It utilizes these device-specific
header (and linker command) files, though it is automatically included by including the Driver
Library’s own header file <driverlib.h>.
MSP430 Workshop - Programming C with CCS 2 - 25