With the brief intro on msp let us start programming the controller. We ‘ll need IDE to write and compile the code and a programmer to transfer the code, and the controller.I’ll be using MSP430G2231 (Launch Pad) which has a Flash emulation tool (FET) on the board itself and IAR Embedded workbench kick-start edition.Download and install the software.Now that we’ve the tools at hand lets begin.Open IAR and create a new project with the toolchain as MSP430 and template as C>main.Here is a screen shot of the software.
Press ok and name the project and press finish to get a c file which looks like the one shown below
I’ve named the project as blink.The file main.c is the source file and we’ll be writing the code here.On the left is the workspace which shows the file present in the project.
To select the required controller open the target options window by clicking on the menu option :
Project > Options
select the required controller in the general options and also select the Debugger option in the same window as
- FET debugger if the code is to be transferred to the controller
- Simulator to simulate the code on the IDE.
Be sure to click the project on the workspace before going to options as the options may open for the other files if they were last clicked rendering the debug options greyed out.
To program a controller connect the controller via usb and hit the Project >> Download & debug
option on the menu.
Debugger :FET Debugger
Device : MSP430F2012
As the G series has not yet been added I use F2012 as a device .The mapping is same for both the devices .If G2231 is available then select it.