Introduction
The hands-on laboratory consists of configuring the I/O ports, setting up the input lines to read push buttons and the output lines to feed LEDs. The following exercises have been developed for the three hardware development tools.
The first to be discussed is the MSP-EXP430FG4618 Experimenter’s board. Modifications are later made to suit the other development boards. The main differences between the boards are related to the specific ports in which the buttons and LED are (or can be) connected. For the development of this laboratory, Code Composer Essentials v3 has been used.
Procedure
Using the Lab1: Blinking the LED example, independently of the hardware development tool, reduce the value of the software delay to half its previous value.
#include "msp430xG46x.h"
void main (void){
volatile unsigned int i;
WDTCTL = WDTPW | WDTHOLD; // Stop Watchdog Timer
P2DIR |= 0x04; // Configure P2.2 as Output
while(1){ // Infinite loop
i=30000; // Delay
do (i--);
while (i !=0);
P2OUT ^= 0x04; // Toggle Port P2.2 using an exclusive-OR
}
}
- In order for a rate of two blinking LED state transition each second, the software delay loop should count to approximately 15000 {15000 / 32768 = 0.5 sec};
i=15000; //Delay
This example and many others are available on the MSP430 Teaching ROM.
Request this ROM, and our other Teaching Materials here https://www-a.ti.com/apps/dspuniv/teaching_rom_request.asp









"This is an excerpt from the MSP430 Teaching CD produced under TI sponsorship and review at the University Beira Interior in Portugal. The material covers everything from "hello world" on an eZ430 […]"