<< Chapter < Page Chapter >> Page >
Using the MSP430-EXP430FG4618 Development Tool and the eZ430 kits blink the LED1 half the speed.

Laboratory gpio: lab2 - blinking the led half the speed

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 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)

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Teaching and classroom laboratories based on the “ez430” and "experimenter's board" msp430 microcontroller platforms and code composer essentials. OpenStax CNX. May 19, 2009 Download for free at http://cnx.org/content/col10706/1.3
Google Play and the Google Play logo are trademarks of Google Inc.

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?

Ask