34
My code examples will give you an idea of what to copy. Keep in mind to stop the watchdog timer in
the beginning of your code or it may reset your micro before entering actual application.
Optional Customizations
Explore the IDE Preferences for customizing CCS IDE according to your wishes. For instance, unlike the
default white theme, I like a full black IDE interface like the one in Sublime Text. This is really effective
when you work at night and in low light conditions. Just like Sublime Text key words are highlighted
and it is easy to navigate in such an environment.
In a busy world, we often forget to update software in regular schedules and therefore miss important
changes and bug fixes. Automatic updates come in aid in such case. I configured my CCS in such a way
that it auto updates and notifies me about new software versions. I also added some tools from CCS/TI
App Store like the GCC compiler.
Other customizations include MSP430Ware and EnergyTrace Technology debugger. EnergyTrace
Technology allows us to compute energy consumptions. It helps in estimating battery requirements
(if any). I recommend readers to explore CCS IDE properties for more custom settings.
Advanced Concepts
Most of the times during code compilation you’ll notice that the compiler not only compiled your code
but has also given you some optional advices. These advices aid in code optimizations and hint ways
to enhance overall performance. For instance, it is better to use switch-case statements instead of if-
else statements when dealing with fixed-discrete conditions. Try to follow the advices whenever
possible. Same goes for compiler warnings. You must address the warnings for flawless coding.
In the internet, we can find lot of documents on C code optimization and good C language practices.
Here is one such document from Atmel: http://www.atmel.com/images/doc8453.pdf. Although it was
written for Atmel AVR microcontrollers but the document applies for all microcontrollers and C
compilers. Similarly, Microchip has documents named Tips ‘n Tricks. Visit and search Microchip’s site
for these documents These tricks and tips help in designs significantly. Try to follow these to achieve
best utilization of your micro’s assets. TI’s application notes are also equally helpful literatures.
Personally, I recommend studying the app notes, and other documents of other micro families too.
This will help advance in developing new concepts, strategies and techniques.
Additionally, I would like to point out some issues and techniques when using CCS. Here are followings:
• Be careful about case sensitivity. Also, be careful about compiler’s reserved keywords and
constants.
• Although not mandatory, it is, however, a good practice not to keep empty argument field in
any function. Argumentless functions should have void argument instead of empty spaces.