Beginning with TI MSP430 microcontrollers

This tutorial introduces the reader to the MSP-EXP430G2 Launchpad from Texas Instruments. The Launchpads are microcontroller development kits that come in variety of flavors depending on project needs. The Launchpads are fitted with MSP430 microcontrollers, which are part of TI’s ultra lower power line of microcontrollers. The MSP430G2 comes with the MSP430G2553 microcontroller more specifically. This micrcontroller contains a powerful 16-bit RISC CPU with 16-bit registers. This device only consumes 230 μA of current in its active running at 1MHz with 2.2V supply voltage. It also comes with 5 power saving modes that can be utilized as need be.

Functional diagram of the MSP430G2553

Functional diagram of the MSP430G2553


Hello MSP430!

As “Hello world!” is usually the first program written by beginners in the software world, first thing to do to get accustomed with microcontrollers is to make LEDs blink! However, before we make the LEDs blink, we need to setup our development environment.

Download & Install Code Composer Studio

Code Composer Studio (CSS) is an IDE developed by TI that allows development for its line of microcontrollers. If the reader is used to programming with IDEs such as Eclipse then he/she will feel right at home with it. Be sure to download the latest version of CCS, which happens to be v6.0.1 at the writing of this post.

Note that there are alternatives to CCS such as Energia that are more beginner friendly but since we would like to program in C and not use the wrapper libraries that abstract away the interesting details of embedded development, we are going to stick with CCS.

A little theory first

Much of what we are gonna do in this series of tutorials is flipping bits in the registers of the microcontroller. So in order to understand the code, we need to what the instructions mean and how they manipulate the bits in the registers. There are 4 primary operations that can be performed on numbers represented in binary: NOT, AND, OR. & XOR. Each one is explained in more detail below with examples:

  • NOTThe not operation flips the value of the bit, ie. if the value of the register is 10010, it’s value after NOT operation will be 01101. The syntax for NOT operation in C is using the ~ operator. An example of this can be seen below:
    int main(void) {
    }
  • AND
  • OR
  • XOR

This is some code

[\code]

Leave a comment