<< Chapter < Page Chapter >> Page >

Creating a project in iar

If you want to create your own project in IAR, you need to repeat these steps:

  • Connect the eZ430-RF2500 programming board to the computer and open IAR;
  • Choose Create new project in current workspace ;
  • Leave Tool Chain to MSP430; as project template, choose C>main ; click OK ;
  • Create a directory on your desktop in which you save your project;
  • Go to Project>Option (Alt+F7) , in General Option, choose Device=MSP430F2274 ; in Debugger, choose Driver=FET Debugger .
For your convenience, you can download the entire source code for the labs in this collection, organized in IAR projects. Open source_code/iar_v4.11.lab_ezwsn.eww and browse through the different projects in the Workspace panel on the left.

Running the code

  • Copy the following code into IAR Alternatively, this code is available in the downloadable source code . Open source_code/iar_v4.11/lab_ezwsn.eww with IAR. The project corresponding to this section is called led_steady . .
  • Compile and download the code onto the board (Ctrl+D) .
  • Let the code execute (F5) , you should now see both LEDs on.

#include "io430.h" int main( void ){ WDTCTL = WDTPW + WDTHOLD;P1DIR |= 0x03; P1OUT |= 0x03;while(1); }
Switching on both LEDs

Some keys for understanding the code:

  • Line 1 : io430.h contains all the macros used for translating human readable values (e.g. P1DIR ) into actual memory location. Right click on io430.h and choose Open "io430.h" to see its content.
  • Line 4 : The MSP430 has a watchdog timer which resets the board if it is not reset before it elapses. This way, if you code hangs, the board restarts and continuesfunctioning. For our simple examples, we disactivate this function by writing the correct values into register WDTCTL .
  • Line 5 declares P1.0 and P1.1 as output pins. This is done by turning bits 0 and 1 to 1 in register P1DIR ;
  • Line 6 sets the output state of pins P1.0 and P1.1 to logic 1 (physically somewhere between 2.2V an 3.5V). This causes the LEDs, connected to those pins, tolight.
  • Line 7 loops, leaving the board running.

Energy consumption

  • Comment out line 6 and run the board from the battery unit. Use the resistor jumper and the oscilloscope to read out the default energy consumption (i.e.MSP430 running, no LEDs, no CC2500);
  • Repeat this by leaving line 6. By subtracting the results, you can measure the energy consumption of the LEDs;
  • replace line 6 by P1OUT |= 0x01 and P1OUT |= 0x02 will leave on the red and green LEDs only, respectively. You can now measure the consumptionof the LEDs independently.

Make sure you obtain results close to the ones presented in the following table.

Current consumed by the LEDs
no lEDs (MSP430 running) 3.12mA
red+green LED 9.12-3.12=6.00mA
red LED 7.04-3.12=3.92mA
green LED 5.20-3.12=2.08mA

Questions & Answers

if three forces F1.f2 .f3 act at a point on a Cartesian plane in the daigram .....so if the question says write down the x and y components ..... I really don't understand
Syamthanda Reply
hey , can you please explain oxidation reaction & redox ?
Boitumelo Reply
hey , can you please explain oxidation reaction and redox ?
Boitumelo
for grade 12 or grade 11?
Sibulele
the value of V1 and V2
Tumelo Reply
advantages of electrons in a circuit
Rethabile Reply
we're do you find electromagnetism past papers
Ntombifuthi
what a normal force
Tholulwazi Reply
it is the force or component of the force that the surface exert on an object incontact with it and which acts perpendicular to the surface
Sihle
what is physics?
Petrus Reply
what is the half reaction of Potassium and chlorine
Anna Reply
how to calculate coefficient of static friction
Lisa Reply
how to calculate static friction
Lisa
How to calculate a current
Tumelo
how to calculate the magnitude of horizontal component of the applied force
Mogano
How to calculate force
Monambi
a structure of a thermocouple used to measure inner temperature
Anna Reply
a fixed gas of a mass is held at standard pressure temperature of 15 degrees Celsius .Calculate the temperature of the gas in Celsius if the pressure is changed to 2×10 to the power 4
Amahle Reply
How is energy being used in bonding?
Raymond Reply
what is acceleration
Syamthanda Reply
a rate of change in velocity of an object whith respect to time
Khuthadzo
how can we find the moment of torque of a circular object
Kidist
Acceleration is a rate of change in velocity.
Justice
t =r×f
Khuthadzo
how to calculate tension by substitution
Precious Reply
hi
Shongi
hi
Leago
use fnet method. how many obects are being calculated ?
Khuthadzo
khuthadzo hii
Hulisani
how to calculate acceleration and tension force
Lungile Reply
you use Fnet equals ma , newtoms second law formula
Masego
please help me with vectors in two dimensions
Mulaudzi Reply
how to calculate normal force
Mulaudzi
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Ezwsn: experimenting with wireless sensor networks using the ez430-rf2500. OpenStax CNX. Apr 26, 2009 Download for free at http://cnx.org/content/col10684/1.10
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Ezwsn: experimenting with wireless sensor networks using the ez430-rf2500' conversation and receive update notifications?

Ask