Writing MSP430 C Code
Writing MSP430 C Code
As part of the prerequisites for the workshop, we stated that you should be familiar with the C
language; therefore, in this section we do not plan to cover general C language syntax. Rather,
this section is dedicated to implementation details of the MSP430 C Compiler.
Build Config & Options
TI C compilers offer nearly a hundred different build options. We plan to focus on just a few
options so that you’re aware of the most common ones.
You should find the table below broken into three sets of options:
Processor Options
• Early MSP430 CPU’s were 16-bit only processors and could only address 64K bytes. Most of
the MSP430 devices from the F2xx series onward utilize the MSP430X CPU which contains
eXtended 20-bit addressing (up to 1MB).
• The –silicon_version option lets you choose which CPU to compile for. CCS chooses this
option for you based on the device you select when creating a new project. Nowadays, it’s
almost always mspx.
• By default, the --code_model option follows the CPU type; therefore, it’s most common to
see large as the common default.
• The --data_model defaults to small, which constrains data to 64K (addresses to 16-bits);
restricted means addresses can be 32-bits, but no data objects can be over 64KB;
large indicates that addresses are 32-bits and there are no restrictions on data objects.
2 - 20 MSP430 Workshop - Programming C with CCS