<< Chapter < Page | Chapter >> Page > |
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.
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 TimerP2DIR |= 0x04; // Configure P2.2 as Output
while(1){ // Infinite loopi=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 (External Link)
Notification Switch
Would you like to follow the 'Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials' conversation and receive update notifications?