Home

Imote2.Builder Kit Manual

image

Contents

1. 2445 en NTS em212 72455 Ch 2 NN Ch235 27165 Ch24 2470 Caza 2475 Ch26 2480 public enum RadioPower ushort MODBM 31 M1DBM 27 M3DBM 23 M5DBM 19 M DBM 15 MIODBM 11 M15SDBM 7 M25DBM 3 To set various radio options public bool SetRadioopt on Rad ooption option ushort val Val d options are LocalAddress 0x0000 OxFFFF PANAddress 0x0000 OxFFFF Channel 11 26 Frequency 2400 2483 MHz RFPower 1 31 1 25dBm 31 0dBm Doc 7430 0765 01 Rev A Page 39 Imote2 Builder Kit Manual Crossb w 8 2 1 2 Send Receive To send data e lre7koolz c nd shore dsterenadar usherer dserddr See dara Receive data sent to this device from a specified source or return null if no frame received within a given timeout public byte ReceiveSrc ser Sic aml cleaner In herr SrenAdde meal Mir Mes ob To receive data sent to this device from any source or return null if no frame received within a given timeout period public byte ReceiveAny mers monas rer re 2 rerzucherersrerecdr in icon 8 2 1 3 TinyOS compatability Note that TinyOS employs a specific 805 14 packet we extend the radio support for TinyOS and provided the functionalities in TOSRadio cs TinyOS specifics such as amType groupID etc can be set via property in class TOSRadio The Receive method has been overriden to return the TosMsg A new method to support Promiscuous listening p
2. Crossbow Technology Inc 4145N First Street San Jose CA 95134 Phone 408 965 3300 Fax 408 324 4840 Email info xbow com Website www xbow com
3. 2047 1606 2047 g 1598 7 You may repeat this exercise for all the Imote2s and sensor boards in your kit Page 12 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 4 2 Runthe Imote2 Builder Blink project During the installation of Imote2 builder SDK a number of sample applications were included to demonstrate the features of the platform easily The steps below outline how to program Blink application into the Imote2 1 Open Crossbow app Blink from Windows Start gt Programs gt Crossbow gt Imote2 Builder gt Sample App gt Crossbow app Blink 2 If the following dialog window appears select Visual CH Development Settings and click on Start Visual Studio 2 Choose Default Environment Settings Visual Studio2005 Before you begin using Visual Studio for the first time you need to specify the type of development activity you engage in the most such as Visual Basic or Visual C Visual Studio uses this information to apply a predefined collection of settings to the development environment that is designed For your development activity You can choose to use different collection of settings at any time From the Tools menu choose Import and Export Settings and then choose Reset all settings Choose your default environment settings General Development Settings Description visual Basic Development Settings Customizes the environment to maximize code Visual C Development Se
4. Builder Browse 6 Confirm your selections and click on Install Page 8 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual Setup is now ready to begin installing Imote Builder on your computer Click Install to continue with the installation or click Back f you want to review or change any settings Destination location C Program Files VCrossbow lmote Builder Start Menu folder Crossbow Imote Builder Additional tasks Microsoft NET Framework 2 0 Microsoft NET Micro Framework 2 0 Imote Builder SOK and Sample Apps Additional icons Create a desktop icon 7 Ifyou see the message below click on OK E Microsoft NET Micro Framework SDK 2 0 Install Microsoft NET Micro Framework SDK 2 0 requires visual Studio 2005 to be installed 8 You will see an installation wizard for Microsoft NET Micro Framework Click on Next gt Microsoft NET Micro Framework SDK 2 0 Setup Wizard Welcome to the Setup Wizard for Microsoft NET Micro Framework SDK 2 0 The Setup Wizard will install Microsoft NET Micro Framework SDE 2 0 on our computer To continue click Next WARNING This computer program is protected by copyright law and international treaties Unauthorized duplication or distribution of this program or any portion of it may result in severe civil or criminal penalties and will be prosecuted to the maximum extent possible under the law NET Micro
5. bin Rel ease gt NOTE The Imote2 hardware in the kit is configured from the factory with the TinyCLR version included on the CD If you need to update the TinyCLR with more recent version available from Crossbow you need to restore update TinyCLR onto your Imote2 To do this start MFDeploy navigate to lt mote2 Builder bin srec TinyCLR and select these 3 files ER CONFIG ER DAT ER FLASH and deploy them on to the Imote2 Page 34 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 7 5 MotePong MotePong is a demo application that maps sensor control input from the XAccel firmware application for use as a device controller in a simple Pong game To start a game first connect an ITS400 equipped Imote2 running XAccel either directly through USB or via remote wireless through an XSniffer base to the PC Power all motes and then start MotePong To start game play select Game gt New Game from the menu The speed of the ball movement can be set from the Difficulty menu MotePong 1 0 JO x Game Difficulty The tilt measurement of the z axis accelerometer is used to control the paddle Hold the mote vertically with the USB cable in between your middle and ring fingers When the mote is directly vertical the paddle will be in the middle of the playing area To move the paddle up to the top of the screen tilt the mote left Horizontal left will place the paddle in the maximum upward position To move the paddl
6. install this software Follow these installation steps l 2 3 Insert the mote2 Builder SDK CD into the computer s CD drive Double click on Imote2BuilderSetup_ lt version gt exe located under Installer folder of the CD At the Welcome to the Imote2 Builder Setup Wizard window click on Next gt 1 Setup Imote2 Builder Welcome to the Imote Builder Setup Wizard This will install Imote Builder 1 0 4 on your computer It is recommended that you close all other applications before continuing Click Next to continue or Cancel to exit Setup 4 Select the desired installation directory then click on Next gt Doc 7430 0765 01 Rev A Page 7 Imote2 Builder Kit Manual Crossb w 5 Setup Imote Builder Select Destination Location Where should Imote Builder be installed ad Setup will install Imote Builder into the following folder To continue click Next f you would like to select a different folder click Browse C Program Files Crossbow lmote Builder At least 9 1 MB of free disk space is required hes 5 Select all available installation tasks recommended and click on Next gt 15 Setup Imote2 Builder Select Start Menu Folder Where should Setup place the program s shortcuts Fm Fr Setup will create the programs shortcuts in the following Start Menu folder To continue click Next f you would like to select a different folder click Browse Crossbow imote
7. 4 1 XSniffer Light Pattern Light Pattern Blue solid flashing Yellow whenever packet is overheard 6 4 2 Compatible PC Tools The XSniffer app can be used with XSniffer GUI to view data 6 5 XSensorlTS400 This application will periodically send a packet filled with one sample from each sensor on the ITS400 board The packet includes the following sensor readings temperature light accelerometer X Y and Z axis ADC all four channels The default data rate is once every 5 seconds This application serves as a good example for how to link in the various sensor drivers and initiate sampling in the NET Micro framework environment The application also offers an alert mode in which an alert will print out if the temperature exceeds a certain threshold The temperature threshold is set as 40 degree C as shown below if ALERT ENABLED conse float threshold 40 float temp OE To enable the alert functionality simply uncomment the following line of code in the file XSensorlTS400 cs OST Sensor lisau0 es w lols 2007 09 19 21 505355 nu Bae gt a eana scher aa aae aaea eme oaa Jae destine ALERT ENAPLED As an alternative you can also go into project property build General section and type ALERT ENABLE in the textbox next to Conditional compilation symbols Page 24 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 20 x5ensorIT5400 Microsoft Visual Studio Ioj x File Edit Vie
8. Cyclical Redundancy Check of a packet 8 4 2 HDLC Implement a byte stream framing using PPP HDLC like protocol See RFC 1662 8 4 3 SerialDump A class that dumps message over the USB port To dump a byte array to USB aran volil print byes Str To dump a string to USB Doc 7430 0765 01 Rev A Page 43 Imote2 Builder Kit Manual Crossb w Pre Serge 8 4 4 UniquelD Allows applications to read out information including SerialID SKU OEM UID etc 8 4 5 PowerManagement Implement the power management API such as putting the mote to deep sleep drawing 525 uA for a specified period of time To put the mote into deep sleep mode call the following method PowerManagement pm new PowerManagement pm DeepSleep 30 The mote will go into deep sleep state for 30 seconds The PowerManagement class contains the following member functions void DeepSleep uint duration void SetCoreFreq uint freq uint GetCoreFreq void SeeCorevVolvage uint vileg float GetCoreVoltage uint GetResetCause Currently only DeepSleep is implemented The rest are to be implemented in the future release 6 WARNING When the Imote2 recovers from the deep sleep state it is a reboot For information that needs to be preserve over reboots it has to be written to the flash The sample application XSensor TS400Sleep demonstrates how to accomplish this by using ExtendedWeakReference 8 4 6 TinyOS Compatibility The Crossbow lib util
9. Microsoft SPOT Hardware I2CDevice EEPROM Microsoft SPOT ExtendedWeakReference ITS400 sensor board Crossbow sensor its400 1ts400 Page 36 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual ADC Crossbow sensor its400 Its400Adc Accelerometer Sensor Crossbow sensor its400 AccelerometerSensor Light Sensor Crossbow sensor its400 lts400Light Temperature Sensor Crossbow sensor its400 lts400 Temp Humidity Sensor Crossbow sensor its400 TempHumSensor 8 1 Platform The Crossbow platform imote2 namespace contains classes for low level access to the mote hardware 8 1 1 LED The LED functionality is wrapped in class Leds Leds cs To turn the LED on and off puppe puber Pub les Ford FedOA 5 pusle JON jolie verd crisol Punilla To Set LED to integer value from 0 to 7 public vorerst mes void setRGB LedColor rgb LED Color enumeration values BLACK RED GREEN BLUE PURPLE CYAN YELLOW WHITE 8 1 2 UART UART class provides access to COM1 on the Imote2 its default setting is 115200 8N1 no flow control To write data to COM1 ene verd makte eee Isai ae engen To read data from COM I public int Read byte recvBuf int count int timeout To flush COMI Doc 7430 0765 01 Rev A Page 37 Imote2 Builder Kit Manual Crossb w publ orde sn 8 1 3 Pins Pins cs contains class Pins which defines the PXA271 GPIO lines available in the Imote2 hardware This class provides a mapping of GPIO l
10. Start gt Programs gt Crossbow gt Imote2 Builder gt Tools gt MotePlot 11 Specify the connection to be USBSPOT and click on CONNECT 12 Select an axis to plot and observe accelerometer data charting in real time 7 2 XSniffer The XSniffer 2 0 GUI tool that is able to connect to an Imote2 over the USB is enclosed XSniffer can be used to monitor and display the radio messages overhead within its radio range 1 Flash the XSniffer firmware application to the mote using Visual Studio 2 Start the XSniffer GUI application from Windows Start gt Programs gt Crossbow gt XSniffer gt XSniffer 2 0 3 Check on USB Spot connection and click on Start 4 Any radio packets overheard will be displayed in the XSniffer GUI For specific packets types look under respective tabs Route Health Neighbor TimeSync etc applicable to XMesh enabled packets or use Options tab to set display filter etc xsniffer 2 0 0 Ju Control ogee PAUSE SerialPort 115200 baud ElapsedTime 00 02 36 2 t Hostrflocalhos 0 Logging No Clear USB Spot Port Filter None Page 30 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 7 3 SerialDump The SerialDump tool will print the data an Imote2 1s sending over its USB port out onto a simple text based terminal window All the source code for the SerialDump application is also provided under lt mote2 bu
11. TSL2651Light Sensor Maxim MAX1363 4 Channel General Purpose A D for quick prototyping TI Tmp175 Digital Temperature Sensor with two wire interface For more detailed information about these boards refer to the Imote2 hardware reference manual Doc 7430 0765 01 Rev A Page 3 Imote2 Builder Kit Manual Crossb w 3 Software Installation 3 1 Supported PC Platforms and Operating Systems The Imote2 builder SDK is supported on the following platforms e Windows XP Home e Window XP Professional e Windows 2000 with SP4 3 1 1 PC Interface Port Requirements The Imote2 Builder Kit requires a USB port to provide connectivity to the development device and gateway 3 2 USB driver installation gt IMPORTANT Every time you connect an Imote2 to the USB port of your PC you should press reset button for the PC to identify your hardware The reset push button SW1 is found just above the mini USB connector The USB driver installation needs to be done at the very first time l After you plug in the Imote2 via USB cable to your PC press the reset button The Green LED would turn on for 2 seconds and the following window will pop up Found New Hardware Wizard Welcome to the Found New Hardware Wizard This wizard helps you install software for Crossbow Mote 9 If your hardware came with an installation CD 969 or floppy disk insert it now What do you want the wizard to do Install the software automatically Recommend
12. equal banks of 64 KB The PXA271 is a multi chip module that includes three chips in a single package the processor 32 MB SDRAM and 32 MB of flash The processor integrates many I O options making it Page 2 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual extremely flexible in supporting different sensors A Ds radio options etc These I O options include I2C 3 Synchronous Serial Ports one of which dedicated to the radio 3 high speed UARTs GPIOs SDIO USB client and host AC97 and I2S audio codec interfaces fast infrared port PWM Camera Interface and a high speed bus Mobile Scaleable Link The processor also adds many timers and a real time clock The PXA271 also includes a wireless MMX coprocessor to accelerate multimedia operations It adds 30 new media processor instructions support for alignment and video operations and compatibility with Intel MMX and SSE integer instructions 2 2 ITS400 Sensor Board The basic sensor board is designed to connect to the basic connectors on the Imote2 It contains a 3d Accelerometer advanced temp humidity sensor light sensor and 4 channel A D It 1s a pass through board to allow stacking with another sensor communication board The sensor board is multi sensor board that combines a popular set of sensors for wireless sensor network applications including ST Micro LIS3L02DQ 3d 12 bit 2g accelerometer High Accuracy 0 3 C Sensirion SHT15 temperature humidity sensor TAOS
13. return the raw reading Conversion formula TempC TempRaw 10 8 1 6 8 3 4 ST Micro Accelerometer AccelerometerSensor cs Public properties float ChannelX return X axis accelerometer reading in unit G float ChannelY return Y axis accelerometer reading in unit G float ChannelZ return Z axis accelerometer reading in unit G ushort ChannelXRaw return X axis accelerometer raw reading Page 42 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual ushort ChannelYRaw return Y axis accelerometer raw reading ushort ChannelZRaw return Z axis accelerometer raw reading Conversion formula name Clranmeal Rew O 8 3 5 Maxim ADC ADCSensor cs Public properties float Channeld return ADC channel 0 reading in volt float Channell return ADC channel 1 reading in volt float ChannelZ return ADC channel 2 reading in volt float Channels return ADC channel 3 reading in volt ushort Channel0Raw return ADC channel 0 raw reading ushort ChannellRaw return ADC channel 1 raw reading ushort Channel2Raw return ADC channel 2 raw reading 5 ushort Channel3Raw return ADC channel raw reading Conversion formula Ghianne LAS Chmelar OS NOTE The ADC reading is a value between 0 and 3V the voltage applied to the ADC channel If the voltage is greater than 3v it is capped at 3V 8 4 Utilities The Crossbow lib utils namespace contains a number of utility classes 8 4 1 CRC Compute CRC
14. that is included as part of the Microsoft NET Micro Framework 5 1 Reference Manual The Microsoft NET Micro Framework includes documentation for the class libraries included This documentation can be accessed by going to Windows Start gt Programs gt Microsoft NET Micro Framework gt Microsoft NET Micro Framework 2 0 Documentation The NET Micro Framework References Microsoft Visual Studio 2005 Documentation Microsoft Document Explorer BAX File Edit View Tools Window Help O Back gt 2 a A amp How Do I Q Search 3 Index 3 Contents Help Favorites Emos 5 J Ask a Question YA The NET Micr ork References mer Filtered by URL ms help M5 V5CC v80 M5 VSIPCC v80 M5VS PSDK PSDK PSDK Ref htm no Filter hd NET Micro Framework Platform SDK NET Micro Framework Development A The NET Micro Fralurt ork References The NET Micro Framework Platform SDK EI Collapse All Legal Notice ick id The Microsoft NET Micro Framework class library contains the namespaces listed on this page and Quick Start Guide the classes and other API elements contained in those namespaces Overviews of the NET Micro Framework B Microsoft SPOT In This Section l Microsoft SPOT Cryptography Microsoft SPOT Namespace l Microsoft SPOT Hardware The Microsoft SPOT namespace contains classes delegates and enumerations that are specific to Microsoft SPOT Inp
15. the USB cable included in the kit and then press the reset button Wait for the green LED to turn off indicating the completion of booting process 5 On the right hand side Solution Explorer double click on the Properties subfolder and select the Micro Framework tab Specify USB from the Transport pull down menu and verify that the device name appears Page 14 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 20 Blink Microsoft Visual Studio Oj x File Edit View Project Build Debug Data Tools Window Community Help al dv 2 Ag v 6 E P Debug gt Any CPU 22 ol ve gt _ a aT af zi Blink Blink cs Solution Explorer Solution Blink 1 pro X 1 i a 2 g Application oe Solution Blink 1 project Configuration active Debug v Platform active Ary CPU v E 28 Crossbow app Build f Blink f de Mi Build Events Sj References me Deployment ct Blink cs Debug README txt Transport USB Resources Settings Device Imote2_a7e70ea2 v Reference Paths Micro Framework AN O Warnings i 0 Messages Description File pre Find Symbol Results Ready 6 To start debugging press the play button or press the F5 key This will compile the project upload the code to the Imote2 and begin running the code n debug mode indicated by Deplo
16. 007 5 05 PM TjsocketServer File Folder 41512007 5 05 PM IGjSocketClient File Folder 41512007 5 05 PM Tj5ampleEmulator File Folder 41512007 5 05 PM Presentation File Folder 4 3 2007 5 05 PM jExtendedweakReferences File Folder 41512007 5 05 PM NOTE TCP IP socket is not yet supported in NET MF v2 as such SocketServer and SocketClient do not run on this Imote2 builder release 5 2 1 Threading This sample shows how to use many of the threading features offered by the NET Micro Framework including How to create a thread start it and wait for it to terminate How to create a timer causing a thread pool thread to invoke your method periodically How to have a thread wait on an event signaled by another thread 5 2 2 ExtendedWeakReference This sample shows how to use the Micro Framework s ExtendedWeakReference class to persist data across a reboot of the hardware In particular this sample records how many times the hardware has been rebooted and displays the result in the debugger s Output window Doc 7430 0765 01 Rev A Page 21 Imote2 Builder Kit Manual Crossb w 6 Sample Applications This section will walk you through all the sample applications that are included as part of the Imote2 builder SDK software that are included on the Crossbow CDROM Programming an application into Imote2 using Visual Studio involves the following steps 1 Open the project or solution that you want to program located under Window
17. 31 Imote2 Builder Kit Manual Crossb w 7 4 MFDeploy Micro Framework deploy is a tool that can flash a program image in SREC format into the Imote2 it can also erase the deployed application from the Imote2 7 4 1 Starting the MFDeploy application l Start MFDeploy from Windows Start gt Programs gt Crossbow gt Imote2 Builder gt Tools gt MFDeploy 2 From the Device dropdown select USB If the Mote is connected to the PC via USB and reset button is pressed the ID should show up in the right hand side textbox 6 WARNING After resetting the Imote2 you have a window of 2 seconds to hit the Deploy or Erase button if you are to update the TInyCLR image or to erase the existing managed application Missing this time window will lead to an operation failure and the procedure needs to be redone Deploying a managed C application is not subjected to this 2 second window 7 4 2 Deploying an application to the Imote2 1 Click on Browse and navigate to the location where the hex files reside select the files that you would want to flash g NET Micro Framework Deployment Tool Max Target Options Device USE vel Imote a7e7Dea m Image File C Program PilesyLrossbowilmote2 Builder bin srec vB ows ample pp Bli E pa File Base Address Size Time Stamp LA Program Files Crossbows mote2 Builder binks OsD00600000 00000487 9132007 5 44 30 PM Page 32 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manu
18. Framework Cancel 9 Be sure to read and accept the license agreement and then click on Next gt Doc 7430 0765 01 Rev A Page 9 Imote2 Builder Kit Manual Crossb w y Microsoft NET Micro Framework SDK 2 0 Setup Wizard License Agreement You must accept the enclosed License Agreement before you can use this product accept the terms of the License Agreement you are not authorized to use this pro accept click I Accept then click Next Otherwise click Cancel a MICROSOFT SOFTWARE LICENSE TERMS MICROSOFT NET MICRO FRAMEWORK V 2 0 These license terms are an agreement between Microsoft Corporation or based on where you live one of its affiliates and you Please read them They apply to the software named above which includes the media on which you received it if any The terms also apply to any Microsoft 1 do not accept the terms in the license agreement 10 Check the Complete install and click on and Next gt then Install J Microsoft NET Micro Framework SDK 2 0 Setup Wizard Setup Type Choose the setup type that best suits your needs Please select 4 setup type All program Features will be installed Requires the most disk space Choose which program features you want installed and where they will be installed Recommended for advanced users 11 The set up would also install XSniffer GUI Tool as a part of the installation process Click on Next gt at the setup d
19. Humidity reading from Sensirion sensor uint16 t flight Light reading from Taos sensor uint16 adt ADC reading from channel 1 uint16_t adc2 ADC reading from channel 2 uint16_t pade3 ADC reading from channel 3 6 5 3 Compatible PC Tools The XSensorITS400 can be used with Serial Dump console to view raw data packets 6 6 XAccel This firmware performs high frequency sampling on the 3 axis accelerometer and streams the data back to the XSniffer or MotePlot PC tools either via radio to a base station or directly over a USB connection 6 6 1 XAccel Light Pattern Light Pattern Purple blinking Yellow twice per second 6 6 2 XAccel Packet Format Table 6 5 Header contents of an XAccel message header Type Field Name Description XSensor packet sub type field XAccel is always a constant value of 0x01 uint16 t Network short address of sending node Table 6 6 Payload contents of an XAccel message untet eount Inerementing sequence number tor yield caleuation unit accel x Accelerometer reading ot Xais unit accel 2 Acvelerometerreading ofZaxs ma uint8_t packet_id uint16_t accel x Accelerometer reading of X axis uint16_t Accelerometer reading of Y axis uint16_t accel z Accelerometer reading of Z axis 6 6 3 Compatible PC Tools The XAccel can be used with MotePlot GUI to view data Page 26 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 6 7 XSensorlTS400Sleep This ap
20. Imote2 Builder Kit Manual Revision A September 2007 PN 7430 0765 01 WWW xDOW com 2007 Crossbow Technology Inc All rights reserved Information in this document is subject to change without notice Crossbow MoteWorks IRIS MICA TrueMesh and XMesh are trademarks of Crossbow Technology Inc Other product and trade names are trademarks or registered trademarks of their respective holders Crossb w Table of Contents About This Document L A 1 1 Imote2 Builder Kit Overview rrnnnrrrrrrvrvvvvrrrrrrrrrrrrrnnnnnnnnnr L2 Package COMES Lasses 2 Hardware Overview sisscsssciessssssssssecasiessdesssnessdssinssnaccecedeecces 2 1 Apote Processor Boards 2 2 115400 Sensor Baader ana ER 3 Software Installation 000000000000000000000000000000000000000000000 3 1 Supported PC Platforms and Operating Systems 32 USBdriyerinstallalion gas aaa 3 3 Additional Software Requirements 4 Application Quick Start sccccccccssssssssssssccccscsessssscsees 4 1 QOUL oL The bp Im air ea 4 2 Run the Imote2 Builder Blink project 4 3 Create your own NET Micro Framework application 5 A dd Sal Retence MLG 5 2 Micro Framework Samples cccccccsssssssssssssseseeeeeees 6 Sample Applications 00000000sssssnnnnnnuunnnnnnsssssssssssssssssse 6I BINE enra EG 02 COnN nda G Bo CR 6 4 ASM OE eni E EE nee Fr Se REE a 6 9 A E A E a OT
21. Sensor is DOS ee Barnes 7 Client Tools and GUL csssossossossoossossssssssssssssssssssssssss00 TNs NTN EE Gog OE EE EE EE A TA MEDIA dci ED NOE LON Disnei DOS 8 Developer API Reference cccccccccssssssssssscccsseseesees Doc 7430 0765 01 Rev A Imote2 Builder Kit Manual Imote2 Builder User s Manual Crossb w Page ii 8 1 8 2 8 3 8 4 Plattform NERE 37 Kaas 38 DCIS OLS EE E ee RE REE en EE 40 TN 43 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual About This Document The following annotations have been used to provide additional information NOTE Note provides additional information about the topic M EXAMPLE Examples are given throughout the manual to help the reader understand the terminology gt IMPORTANT This symbol defines items that have significant meaning to the user 6 WARNING The user should pay particular attention to this symbol It means there is a chance that physical harm could happen to either the person or the equipment The following paragraph heading formatting is used in this manual 1 Heading 1 1 1 Heading 2 1 1 1 Heading 3 This document also uses different body text fonts listed in Table 0 1 to help you distinguish between names of files commands to be typed and output coming from the computer Table 0 1 Font types used in this document Courier New Normal Sample code and screen output Courier New Bold Comma
22. al 2 Reconnect the USB cable to the Imote2 and push the Reset button 3 Wait for the Imote2 ID to show up in the text box and while the green Led is still on click on Deploy button 4 The program will be uploaded and start executing in the Imote2 once the Deployment Status message disappears Deployment Status Deployment Status Erasing sector Og 00640000 Executing Application Cancel Cancel 7 4 3 Erasing a deployed application 1 Reconnect the USB cable to the Imote2 and push the Reset button 2 Wait for the Imote2 ID to show in the text box and while the green Led is still on click on Erase button 3 A pop up windows asks for confirmation for the operation click on the Yes button Confirm Application Erase 4 The following window shows the progress of the erase operation Erase Deployment Status Erasing sector UxU0660000 Cancel NOTE This only clean up the managed application that is deployed to the Imote2 and it is recommended if a corrupted application is deployed to the Imote2 7 4 4 Crossbow pre compiled srec files Doc 7430 0765 01 Rev A Page 33 Imote2 Builder Kit Manual Crossb w The Imote2 Builder SDK installer installs some useful srec files to user s PC These include TinyCLR Crossbow build and Crossbow sample applications e NET Micro Framework aka TinyCLR resides in lt mote2 builder gt bin srec TinyCLR e Crossbow sample applications reside in lt mote2 build
23. allow you to run a demo out of the box 1 Take one Imote2 board connect an ITS400 sensor board to it and connect it to the PC using the USB cable provided 2 Deploy XAccel application onto the Imote2 board using Visual Studio U Click Detach All in the Debug menu or click stop button on the top menu if the project is in debug mode This step detaches the USB of the Imote2 from the crossbow solution The USB port is now available to be connected to MotePlot Start MotePlot from Windows Start gt Programs gt Crossbow gt Imote2 Builder gt Tools gt MotePlot Specify the connection to be USBSPOT and click on CONNECT Select the axis to plot and observe accelerometer data charting in real time A oF St ge The user can zoom into and pan through data as instructed in Table 7 1 within each of the graphs independently of each other Page 28 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual Table 7 1 How to zoom pan and reset in the Charts Icon Desired Action Instructions P To zoom in Click on the Zoom icon i Left click and drag a region to zoom into Release the mouse to complete the region selection To pan through data Click on the Pan icon Left click and drag a point within the chart to the new location Release the mouse button To undo a zoom pan Click on the Undo icon once for each level of undo To zoom out fully Click on the View All icon 7 1 2 Over the Radio Commun
24. d H ea References 7 i ct Program cs Gl aa Resources resx public class Program i public static void Main i Debug Print Resources Get5tring Resources StringResources sString1 sto Fe Find Symbol Results Ready The next step is to add Crossbow library references to your project On the Solution Explorer panel right click the folder References and click on Add Reference the Add Reference window will pop up Select the 4 Crossbow library dll files under NET tab and press OK button Note that you may or may not need to select all 4 library files it all depends on what your application needs Doc 7430 0765 01 Rev A Page 17 Imote2 Builder Kit Manual Crossb w MET Projects Recent Browse Tesla 1 dee or LOGO 7 C Program FilesyCross Feen TT 1 0 0 0 We 0 50727 Agra Fed Crass Microsoft SPOT Graphics 0 0 we 0 50727 on Files Micros Microsoft SPOT Hardware 0 0 We 0 50727 C Program FilesiMlicros Microsoft SPOT Native 0 0 We 0 50727 C Program FilestMicros Microsoft SPOT Wet 0 0 We 0 50727 C Program FilestMicros Microsoft SPOT TinyCore 0 0 We 0 50727 C Program FilestMicros mscorlib 0 0 We 0 50727 C Program FilestMicros System 0 0 We O S0727 C Program FilesiMicros Now add code to your application It is recommended that the following 4 using clauses are added to the code US Mints Were OS Don Maloy vers Hsing Crossbow plaererm I
25. d is both displayed on the LED as a rotating color representing the lower 3 bits and sent over the radio in a packet that contains the full count field in 16 bit resolution Any nodes running CountReceive within radio range of this sender will synchronize to the sending node and display the count 6 2 1 Count Light Pattern Light Pattern Sequentially counts through all 8 colors switching once per second 6 2 2 Count Packet Format Table 6 2 Payload contents of a Count message header Field Name uint16_t Incrementing count field 6 3 CountReceive The CountReceive application is the sibling application to CountSend This application turns on the radio and puts it into receive mode and waits until it hears a properly formed Count packet Once such a packet is received the node will display the lower 3 bits on the LED just like the CountSend application This application can be used to perform simple range tests The radio range can be determined by walking the CountReceive node farther and farther away from the CountSend node until the CountReceive node just stops tracking the count on its LED 6 4 XSniffer This firmware will promiscuously listen for radio packets and forward them via USBSPOT protocol to the USB port The XSniffer can also be used as a base station application for single hop applications such as XSensorITS400 XSensorITS400Sleep and XAccel Doc 7430 0765 01 Rev A Page 23 Imote2 Builder Kit Manual Crossb w 6
26. e System Text The Microsoft SPOT Presentation Controls namespace in the Microsoft NET Micro Framework System Threading provides classes delegates and enumerations you can use to create elements known as controls Extensible Emulator that enable a user to interact with an application kei E Microsoft SPOT Net NetworkInformation Namespace Provides information about network interfaces and enables your applications to control them FE bel ee a Eukamrihla Errar Cu user d 7 er Microsoft SPOT Presentation Media Namespace The Microsoft SPOT Presentation Media namespace in the Microsoft NET Micro Framework y Contents L Index Help Favorites contains classes and enumerations that help you draw and manipulate images v 5 2 Micro Framework Samples The Microsoft NET Micro Framework includes a few sample applications These applications can be accessed by going to Windows Start gt Programs gt Microsoft NET Micro Framework gt Samples Page 20 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 0 C Documents and SettingsynturonyMy Documents Microsoft NET Micro Fr Max File Edit wiew Favorites Tools Help i e g q Peach Es Folders So x MG E Address Gy C Documents and Settings mturon My DocumentsMicrosoft NET Micro FrameworklSamples w Mame Size Type Date Modified CyweakDelegates File Folder 41512007 5 05 PM Threading File Folder 41512
27. e down to the bottom of the screen tilt the mote right Horizontal right will place the paddle in the maximum downward position Doc 7430 0765 01 Rev A Page 35 Imote2 Builder Kit Manual Crossb w 8 Developer API Reference The Imote2 Builder SDK provides APIs for the various hardware subsystems on the Imote2 IPR2400 and sensor board ITS400 hardware This section provides a brief description of the API for various sub system on the Imote2 for more detailed description please refer to the document generated by doxygen at Windows Start gt Programs gt Crossbow gt Imote2 Builder gt document gt API Reference Manual Imote2 Builder Namespace Index Mozilla Firefox Joj x File Edit wiew History Bookmarks Tools Help c output Nu lt a r gt r e fat B File HC Programs 20Files Crossbow Imote Builder doc himl namespaces html E ta Crossbow Intranet Free Hotmail Windows Media Windows Main Page Namespaces Data Structures Files Search for Namespace List Namespace Members Imote2 Builder Namespace List Here is list of all namespaces with brief descriptions Crossbow Crossbow app Crossbow lib Crossbow lib utils Crossbow lib utils tos Crossbow platform Crossbow platform imote2 Crossbow radio Crossbow radio cc2420 Crossbow sensor Crossbow sensor its400 Table 8 1 C Classes included in Imote2 Builder SDK iso Jorosoompitomimere fis
28. ed Click Next to continue 2 Check on Install from a list or specific location and click on Next gt 3 Insert the Imote2 Builder SDK CD into the CDROM drive and browse to USB Drivers folder of the CD and click on Next gt Page 4 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual Found New Hardware Wizard Please choose your search and installation options ES 8 Search for the best driver in these locations Use the check boxes below to limit or expand the default search which includes local paths and removable media The best driver found will be installed Search removable media floppy CD ROM Include this location in the search E Mmote Builder SDK_CDROMSUSB Drivers Don t search will choose the driver to install Choose this option to select the device driver from a list Windows does not guarantee that the driver you choose will be the best match for pour hardware 4 Let the wizard search and install the Crossbow Imote2 driver automatically NOTE If you encounter a warning that the driver is not verified to be compatible with Windows XP Logo as appeared in the following window you may ignore the warning by clicking on Continue Anyway and complete the driver installation Hardware Installation A The software you are installing for this hardware Crossbow iMote has not passed Windows Logo testing to verify its compatibility with Windows XP Tell
29. el s XScale processor PXA271 It integrates an 802 15 4 radio TI CC2420 with an on board antenna It exposes a basic sensor board interface consisting of two connectors on one side of the board and an advanced sensor board interface consisting of two high density connectors on the other side of the board The Imote2 is a modular stackable platform and can be stacked with sensor boards to customize the system to a specific application along with a battery board to supply power to the system tha Reset Button USB Connector 2 1 1 Features PXA271 XScale processor 13 416 MHz Wireless MMX coprocessor 256kB SRAM 32MB FLASH 32MB SDRAM Integrated 802 15 4 radio support for external radios through SDIO and UART Integrated 2 4GHz antenna Multicolor status indicator LED Basic and advanced expansion connectors supporting 3xUART I2C 2xSPI SDIO PS AC97 USB host Camera I F GPIO e Mini USB port for direct PC connection e Size 48 mm x 36 mm PCB Thickness 1 75 mm 2 1 2 Processor The Imote2 contains the PXA271 processor This processor can operate in a low voltage 0 85V and a low frequency 13 MHz mode hence enabling low power operation The frequency can be scaled to 104 MHz at the lowest voltage level and can be increased up to 416MHz with Dynamic Voltage Scaling The processor has many low power modes including sleep and deep sleep modes It also integrates 256 KB of SRAM divided into 4
30. er gt bin srec XBowSampleApp We also include the script that allows users to generate the srec file from their application bin directory The script is Create Srec cmd located in lt Imote2 builder gt Tools MF Deploy To run this script you need to open a DOS command window add lt Imote2 builder gt tools MF Deploy to your search path and change directory into the application folder bin release and then issue this command Create SEG lt app name A srec file lt app name gt hex will be generated under the same folder The screenshot below capture this process ea CA WINDOWS system32 cmd exe C gt set PATH APATHA C Program Files Crossbow Imote 2 Builder tools MFDeploy C gt cd C Program Files Crossbow Imote2 Builder app Accel bin Release C Program Files Crossbow I mote Builder app 4Accel bin Release gt Create Srec Accel C Program Files Crossbow I mote Builder app 4Accel bin Release gt REM this script will cr C Program Files Crossbow I mote Builder app k Accel bin Release gt REH to use it copy it me gt C Program Files Crossbow Imote 2 Builder app 4Accel bin Release gt REM it then will create C Program Files Crossbow I mote Builder app 4Accel bin Release gt REM Created by Ning Ku C Program Files Crossbow I mote Builder app 4Accel bin Release gt ECHO OFF KAccel dat KAccel hex Bx6 0A00 5545 Conversion 1s Successful C Program Files Crossbow I mote Builder app 4Accel
31. he managed sensor drivers 8 3 1 Sensirion Temp Hum sensor In TempHumSensor cs Public properties float Hum return the relative humidity reading in percentile if Ibe sue TempC return the temperature reading in degree C ushort HumRaw return the raw reading of the relative humidity ushort TempRaw return the raw reading of the temperature Conversion formula ann SN ERE TempC TempRaw 0 01 39 6 Doc 7430 0765 01 Rev A Page 41 Imote2 Builder Kit Manual Crossb w 8 3 2 TAOS Light sensor LightSensor cs Public member functions Wintes2 readhuxil0 return che LOX value of che lux Public properties lo eke ene cite hein che rem In luk asken LIGIER return bhe raw reading Conversion formula The conversion is based on a look up table that contains a set of coefficients please look at the implementation of function ReadLux10 in LightSensor cs in namespace crossbow sensor 1ts400 or refer to the TAOS sensor datasheet for the details 8 3 3 Tl Temperature sensor TemperatureSensor cs Public member functions int ReadDegreeC10 int timeout return the 10X value of the temperature in Celsius int ReadDegreeF10 int timeout return the 10X value of the temperature in Fahrenheit int readRaw int timeout return the raw reading from the sensor Public properties float TempC return the temperature reading in degree C float TempF return the temperature reading in degree F ushort TempRaw
32. ialog Page 10 Doc 7430 0765 01 Rev A Crossb w 3 Setup XSniffer 2 0 Imote2 Builder Kit Manual Welcome to the XSniffer 2 0 Setup Wizard This will install Snuffer 2 0 3 on pour computer It ig recommended that pon close all other applications before continuing Click Next to continue or Cancel to exit Setup Cancel 12 Click on Finish to complete the installation Doc 7430 0765 01 Rev A Page 11 Imote2 Builder Kit Manual Crossb w 4 Application Quick Start 4 1 Out of the box demo The Imote2 modules in the Imote2 Builder kit are factory programmed to run a demo out of the box and visualize the sensor data on a PC 1 Take an IPR2400 Imote2 board and an ITS400 sensor board and plug them together 2 Connect the assembly to the PC s USB port using the USB cable provided Press the reset button found just above the mini USB connector The green LED should come on for 2 seconds After 5 seconds you should see solid Red and Blue LEDs with blinking yellow 4 Start MotePlot from Windows Start gt Programs gt Crossbow gt Imote2 Builder gt Tools gt MotePlot Specify the connection to be USBSPOT and click on CONNECT 6 Select an axis to plot and observe accelerometer data charting in real time You can shake or tilt the assembly to see change in accelerometer readings al MotePlot ole High Speed Plot Device JUSESPOT DISCONNECT Chart Accel X Chart Accel Y Chart3 Accel Z
33. ication Star Network This procedure will walk you through the setup of a star network using all the hardware in your Imote2 Builder kit The final system will have two remote sensor nodes powered by battery and a base station connected to your PC via USB The remote nodes will run XAccel and be connected to the sensor board and battery board The base station will run XSniffer firmware The PC will run MotePlot to visualize the data from both nodes giving each a unique color based on their factory programmed unique ID see UID section 8 4 4 ze L Hoh Speed Pia SSS i even fusesror L oesconnecr Om Fa 2 se fer 00 faz KEEB Prepare three Imote2 boards connect an ITS400 sensor board each to two of them Connect first Imote2 with sensor board to the PC using the USB cable provided Deploy the XAccel application in to the Imote2 using Visual Studio l 2 3 4 Click Detach All in the Debug menu or click stop button on the top menu and disconnect the XAccel mote from the PC Doc 7430 0765 01 Rev A Page 29 Imote2 Builder Kit Manual Crossb w 5 Power the Imote2 with sensor board with the battery board 6 Repeat steps 2 5 with the second Imote2 with sensor board 7 Connect the remaining Imote2 board to the PC with the USB cable 8 Deploy the XSniffer application onto the Imote2 using Visual Studio 9 Click Detach All in the Debug menu or click stop button on the top menu 10 MotePlot from Windows
34. ilder gt tools SerialDump to allow developers to quickly get started connecting to the data channel of the Imote2 in the NET environment 1 Start SeriaDump from Windows Start gt Programs gt Crossbow gt Imote2 Builder gt Tools gt SerialDump 2 Observe the packets in the command console ch CA WINDOWS system32 cmd exe o OO OOOO 0 174 3 185 8 127 0 172 3 186 B 128 0 171 3 3 128 128 127 128 127 129 171 172 D E oO amp amp amp D gt 2 2 D gt O 2 2 G O B B B 5 5 5 5 B B 5 5 5 B B 5 32 80 12 127 0 174 3 185 8 128 8 171 3 The above screenshot shows data captured by SerialDump the packet is sent by XAccel application For details of the XAccel packet structure please refer to section 6 6 2 s an illustration let us take a look at the last line of the data set 126 0 50 125 64 32 1 2180 185 0 1270 172 3 185 0 12801733 The first group in blue is the TosMsg header see table 6 1 Address 2 bytes 126 AM type 1 byte 50 Group ID 1 byte 125 Length 1 byte 64 The next group in red is the sensor board header see table 6 5 Sensor board ID 1 byte 32 Packet ID 1 byte Node ID 2 bytes 218 Next are the Accel sensor data the group in green denotes 3 readings from X Y Z axis of the sensor each 1s 2 bytes There are 10 groups in one packet Accel X 2 bytes 185 Accel Y 2 bytes 127 Accel Z 2 bytes 940 Doc 7430 0765 01 Rev A Page
35. ines to type Microsoft SPOT Hardware Cpu Pin In general access to this low level call should be reserved for authors of managed drivers Developers are encouraged to use higher level abstractions of the hardware rather than access these pins directly A good example would be the LEDs which should be accessed through the LED class rather than directly through these pin mappings For driver authors the pin mappings are used as references for instantiation of OutportPort or InputPort objects An example follows Output Port gre EN LED mew Output Port Pins GPTOZPORTZTEDZEREEN true greenLED Write true 8 1 4 Interrupts To enable interrupt on a GPIO pin SUL Ke Tnte r rupt Port Cpu Pin portii joo lalo int ee Port ResistorMode resistor Port Tnterrupr Mode Interrupt To assign the ISR Interrupt Service Routine to an interrupt lt InterruptPort gt OnInterrupt new GPIOInterruptkventHandler lt ISRMethod gt The ISR has the following signature MethodImpl MethodImplOptions Synchronized private void ISRMethod Cpu Pin port bool state TimeSpan time 8 1 5 Radio The radio driver consists of 2 layers PAL Platform Abstraction Layer and HAL Hardware Abstraction Layer The former exists in namespace Crossbow platform imote2 the latter exists in namespace Crossbow radio cc2420 Crossbow also provides TinyOS interoperability wrapper library classes which exist in namespace Crossbow lib utils tos The application wri
36. ipe TONE ENN neo To convert a 805 14 style TosMsg such as used in MicaZ Iris and TelosB to standard TosMsg format public E tell Converts loMicaZMsg Please refer to section 8 4 6 for more of the TinyOS compatibility classes 8 3 Sensors Various sensor drivers exist in the namespace Crossbow sensor its400 Note that the sensor board draws about 15mA current There is a facade class Its400 cs which wraps up all sensor classes and provides a simple interface to the user applications each of the sensors can be read from one of 2 read only properties one for the raw reading the other for the converted value with proper engineering unit Page 40 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual Table 8 2 Sensor properties provided by ITS400 class ReumType Name Desenptien ushort Adc2Raw Raw reading from ADC channel 2 float Converted reading from humidity sensor in umidity percentage HumidityRaw Raw reading from humidity sensor float TempSensirion Converted reading from Sensirion temperature sensor in degree C ushort TempSensirionRaw Raw reading from Sensirion temperature sensor float TempCT Converted reading from Tl temperature sensor in degree C float TempFTI Converted reading from Tl temperature sensor in degree F TempTlRaw Raw reading from TI temperature sensor If you instead prefer not to use the facade class but the individual sensor driver here is a breakdown of t
37. me why this testing is important Continuing your installation of this software may impair or destabilize the correct operation of your system either immediately or in the future Microsoft strongly recommends that you stop this installation now and contact the hardware vendor for software that has passed Windows Logo testing STOP Installation 5 Click on Finish to complete the installation Doc 7430 0765 01 Rev A Page 5 Imote2 Builder Kit Manual Crossb w Found New Hardware Wizard Completing the Found New Hardware Wizard The wizard has finished installing the software for Crossbow iMote Click Finish to close the wizard 6 After the installation is completed successfully Crossbow iMote2 should appear in the Device Manager window this can be accessed from Windows Start gt Control Panel gt System gt Hardware gt Device Manager gt Universal Serial Bus Controllers Device Manager ag File Acton View Help AG Keyboards Mice and other pointing devices 2 Modems 2 Monitors BB Network adapters a PCMCIA adapters A Ports COM amp LPT MR Processors 8 Sound video and game controllers System devices Universal Serial Bus controllers Intel R 8280 1DB DBM USB Universal Host Controller 24C2 Intel R 8280 1DB DBM USB Universal Host Controller 2474 Intel R 8280 1DB DBM USB Universal Host Controller 24C7 Intel R 8280 1DB DBM USB2 Enhanced H
38. more2 be no erossbounzdchonee 120 using Crossbow sensor its400 The next statement simply prints the string Hello World to serial output SerialDump print HEN Page 18 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 29 Hello World Microsoft Yisual Studio i Ioj x File Edit view Project Build Debug Data Tools Window Community Help Er u Ba 9 G E B Debug gt Any CPU 8 hibernate r EAN amp Bl gle ot a A QU Bp AA LF 5 2 0 FG an EB Programus eee Solution Explorer Soluti X Helloworld Program seman Ss i El using System using Microsoft SFPOT using Crossbow lib utils pr Solution Hello orld 1 project E gl HelloWorld Jado de3 10 30 05 i using Crossbow platform imotez using Crosshow radio cc2420 jan Crossbow platform He A Crossbow radio cc H A Crossbow sensor it using Crossbow sensor its400 E namespace HelloWorld sie 43 Microsoft SPOT Na i ee A mscorlib public class Program o GE Program cs i H daa Resources resx public static void Maint Seriallump print Hello World E Fe Find Symbol Results Ready Now you can build and deploy the Hello World application the Imote2 refer to the procedure in section 4 2 on how to perform the deployment Doc 7430 0765 01 Rev A Page 19 Imote2 Builder Kit Manual Crossb w 5 Guided Tour This section provides a tour of the software and documentation
39. nds to be typed by the user Times New Roman Italic TinyOS files names directory names Franklin Medium Condensed Text labels in GUIs Doc 7430 0765 01 Rev A Page iii Crossb w Imote2 Builder Kit Manual 1 Introduction 1 1 Imote2 Builder Kit Overview Imote2 BuilderKit s designed to be a complete development environment for high performance wireless sensor networking WSN applications leveraging the Microsoft NET Framework Code on the Mote tier uses the NET Micro Framework The Imote2 Builder Kit provides the tools to simplify development and deployment of highly customized distributed sensory systems It also makes it easy to connect to a base station mote and capture the resultant data and sensor readings 1 2 Package contents The contents of the Imote2 Builder kit include e 3x Pre programmed IPR2400 Imote2 Processor boards e 2x ITS400 Imote2 Sensor Boards e 2 x IIB2400 Imote2 Battery Boards e 1x USB Cable A Male to Mini Male e 6x AAA 1 5V Alkaline Batteries e 1x CD containing Imote2 Builder SDK CDROM e 1x CD containing Evaluation Copy of Microsoft Visual Studio 2005 Doc 7430 0765 01 Rev A Page 1 Imote2 Builder Kit Manual Crossb w 2 Hardware Overview 2 1 Imote2 Processor Board The Crossbow Imote2 is an advanced sensor network node platform designed for demanding wireless sensor network applications requiring high CPU DSP and wireless link performance and reliability The platform is built around Int
40. ost Controller 24CD USB Root Hub USB Root Hub USB Root Hub USB Root Hub 3 3 Additional Software Requirements For the development environment to run the following additional components are required e Microsoft Visual Studio 2005 Evaluation version included in kit e Microsoft NET Micro 2 0 The installation files for these components are included on their respective CDs included in the Imote2 Builder Kit 3 3 1 Microsoft Visual Studio 2005 All development using the Imote2 Builder Kit is done in C and requires Visual Studio to be installed Follow the steps below for the installation Page 6 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual gt IMPORTANT The Visual Studio 2005 installation should be completed before running the Imote2 Builder SDK installation An internet connection is required for the installation to succeed l It is strongly recommended that you shut down all the programs running on your PC 2 Insert the Microsoft Visual Studio 2005 Evaluation CD into the computer s CD drive 3 4 Read and follow the instructions in Visual C 2005 Express Edition Setup Wizard Double click on the vessetup exe file to proceed window and proceed with the installation 3 3 2 Microsoft NET Micro Framework 2 0 The Microsoft NET Micro Framework provides extensions for doing development on small embedded platforms such as the Imote2 The Imote2 Builder SDK installer can automatically
41. plication 1s similar to the XSensorITS400 application and periodically senses and sends all the sensor data from an ITS400 board The packet format is the same for both applications The main difference here is that this one uses the explicit power management interface to put the mote into a deep sleep state in between samples The application essentially reboots from this deep sleep state at the specified data rate and simply samples the data and sends it over the radio and USB This application uses an ExtendedWeakReference class to persist the packet sequence number across a reboot thus it also serves as an example on how to preserve data while the mote go to deep sleep NOTE The XSensorITS400Sleep application should not be connected to the USB port since it shuts down the USB hardware when it goes to deep sleep mode But if used in conjunction with XSniffer the data sent over the radio can be viewed using Serial Dump or XSniffer GUI Doc 7430 0765 01 Rev A Page 27 Imote2 Builder Kit Manual Crossb w 7 Client Tools and GUI In this section we walk through the tools that are included as part of the Imote2 Builder SDK 7 1 MotePlot The MotePlot GUI is designed to connect with the XAccel application and display the accelerometer readings being sent out by the Mote There are two configurations that are possible 7 1 1 Direct USB Connection This is the default factory application that is programmed into Imote2s in the Kit to
42. radio power are set to 0 dBm conste shert richane Uno Radio Channel ChI const ushort _rfPower ushort RadioPower MODBM Please refer to API section 8 1 5 for the enum definition of rad o power and rad o channel for the CC2420 chip The sample applications use the default radio channel channel 11 and radio power 10dBm Most of the sample applications use a packet format that is compatible with TinyOS the packet carries a 5 byte TosMsg header This header provides Imote2 protocol compatibility with MICA and IRIS motes Table 6 1 TosMsg Header contents Field Name uint16 t Destination address of the packet AM type TinyOS Active Message ID Page 22 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual Length Length of the packet payload Please refer to API section 8 4 6 2 on how to set AM type and group ID for TinyOS radio packets 6 1 Blink This application will simply blink a blue colored LED once every second This application 1s used as the example in section 4 2 earlier in this manual The Blink application is a good test for the timer subsystem of the platform 6 1 1 Blink Light Pattern Light Pattern Blue blinking once per second 6 2 CountSend The CountSend application provides a basic example for using the radio subsystem of the platform This application periodically increments a counter that starts at zero when the node is booted and increments by one every second The count fiel
43. rossb w Project types Templates El Visual C visual Studio installed templates gt Windows E Smart Device q Class Library q Console Application Starter Kiks FN Device Emulator ge Window Application gt Micro Framework E Other Languages My Templates El Other Project Types mi Search Online Templates 4 project for creating MET Micro Framework console applications Mame Hellow orld Location CAMETMFIProjects v Browse Solution Create new Solution Create directory for solution Solution Name Helloworld an We use the classic Hello World as an example in this section After the user clicks the OK button a sub folder Hello World will be created in the folder C NETMF Projects and VS2005 will open the newly created project as shown in the next screenshot Page 16 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 25 HelloWorld Microsoft Yisual Studio E ioj x File Edit View Project Build Debug Data Tools Window Community Help H i 4 B 9 B B pb Deu y Any CPU 3 5 4 gt i i F Eh en fl Ca A el lo ra A Pl a aT at ER A ar EE El EE GJ R a d Program cs Solution Explorer Soluti 4 X A ite Helloworld Program 6 maind en 2 I a M using system 7 bel u project amp Lusing Microsoft SPOT Er y dd En Sd Properties 2 H 3 Ref T E namespace HelloWorl
44. s Start gt Programs gt Crossbow gt Imote2 Builder gt Sample App gt Crossbow app lt app name gt 2 Inthe Solution Explorer section on the right hand side expand the project and double click on the lt app gt cs file 3 Connect an Imote2 board to your PC using the USB cable included in the kit and then press the reset button Wait for the green LED to turn off indicating the completion of booting process 4 On the right hand side explorer double click on the Properties subfolder and select the Micro Framework tab Specify USB from the Transport pull down menu 5 To start debugging press the play button or press the F5 key This will compile the project upload the code to the Imote2 and begin running the code in debug mode indicated by Deploy Succeeded in Status message bar on the lower right hand side 6 When the application downloading is successful to release the USB port click on E stop button or Shift F5 key 7 To deploy the application un tethered with the battery board select Debug gt Detach All All Sample applications that use the radio follow a similar design template to allow simple adjustment of basic configuration parameters To change the radio parameters modify the following 2 lines in the sample application come shore er Chenmell Mello Racer nana Calls ii ehamasa k NA const ushort _rfPower ushort RadioPower M10ODBM 10dbm For example the following changes use the radio channel 12 and
45. s tos namespace contains a number of utility classes for simplifying TinyOS compatibility This allows the Imote2 to interoperate with MicaZ Iris and TelosB motes The following classes exist in namespace Crossbow lib utils tos 8 4 6 1 TosMsg This class encapsulates the TinyOS packet that works with 802 15 4 radio which s used with MICAz IRIS and TelosB Motes The following method converts the message to the default TosMsg format Byte ConvertToMica2Msg Page 44 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual 8 4 6 2 TOSMac TinyOS compatible radio driver a wrapper classes of the RadioCC2420 class The AM type and group ID can be initialized through the constructor Public TOSMac byte am type byte group id Or application can perform get set operations on the public properties amType and groupld By default the AM type is set to 1 the group ID is set to 125 8 4 6 3 TOSRadio This class handles the initialization of the TinyOS compatible radio driver 8 4 6 4 TOSSerialDump This is a subclass of SerialDump it prints out a string to USB port with the TOS header appending to the beginning static void printhWithrosHeader byte str this method sends TosMsg header str to USB port The AM type and group ID field of the TosMsg header can be initialized by setting the corresponding properties By default AM type 1s 0x04 group ID is 0x7D Doc 7430 0765 01 Rev A Page 45 Crossb w
46. ter is given access to the native IEEE 802 15 4 capability on the Imote2 through the Crossbow platform imote2 radio class This class will initialize the radio in 802 15 4 compatibility mode and provides the standard radio API as defined by IrRadioDevice for the USETS 8 2 Radio Driver In this section we explain the radio APIs provided in the namespace Crossbow radio cc2420 and Crossbow lib utils tos To set various radio options Frequency power node address PAN address PUDOC bool Serkeasn Opio acia arto Mee on veker vel Page 38 Doc 7430 0765 01 Rev A Crossb w Imote2 Builder Kit Manual To send out a packet public bool Send ushort dast PanAddr eres Ne To send out a packet requesting acknowledgement public bool AcknowledgedSend vener ollas sia do me lst dradd io me ere To turn on off the receiver public void ReceiverOn bool active To receive packet public byte ReceiveSrc shone SsrePpenaddr ushort srcaddr Int seimeout public byte ReceiveAny Yer ushort srePpmaAddr tet uzhort srcaddr ine tiumeoue 8 2 1 1 Initialization The radio can be initialized via the constructor in class Radio pip Radrio ushort freg Uu Nort power Ushort Panladdress Usnort address The radio frequency and radio power are defined in 2 enums RadioChannel and RadioPower pulblie enum RadioChannel vshore Chile 12105 Chl2 2210 enls Zao Ch14 2420 Choe 22125 Chic 2430 Chl y 24135 Ch18 2440 Ch19
47. ttings editor screen space and improve the visibility of visual C Development Settings commands specific to C Increases productivity Visual J Development Settings with keyboard shortcuts that are designed to be Web Development Settings easy to learn and use Start Visual Studio Exit Visual Studio 3 Inthe Solution Explorer section on the right hand side double click on the Blink cs file Doc 7430 0765 01 Rev A Page 13 Imote2 Builder Kit Manual Crossb w Blink Microsoft Yisual Studio AER File Edit View Project Build Debug Data Tools Window Community Help yy aaa A 9 E b Debug Any CPU gt AAA Gra sarao Q ENGEN EEE 2 OP HB BB RL _ Blink cs Solution Explorer Solution Blink 1 pro X Rg Crossbow app Blink E Blink application toggle the LED on off every second Q Main A Solution Blink 1 project 28 Crossbow app f Blink 1840 3 uONN OG Ro i file Blink cs re aha i H sal References author Martin Turon 2 az 2 L E README txt version 2007 4 5 mturon Initial version Copyright c 2007 Crossbow Technology Inc All rights reserved Id Blink cs v 1 3 2007 08 15 00 31 56 nxu Exp FE using Crossbow platform imote2 Lus ing Crossbow lib utils E namespace Crossbow app public class Blink public static void Maint ae Fe Find Symbol Results Ready 4 Connect an Imote2 board to your PC using
48. ut the Microsoft NET Micro Framework G GE Microsoft SPOT Net NetworkInformation Microsoft SPOT Cryptography Namespace Microsoft SPOT Presentation The Microsoft SPOT Cryptography namespace in the Microsoft NET Micro Framework provides Microsoft SPOT Presentation Controls essential tools for encoding and decoding data Microsoft SPOT Presentation Media Microsoft SPOT Hardware Namespace Microsoft SPOT Presentation Shapes The Microsoft SPOT Hardware namespace in the Microsoft NET Micro Framework provides a System range of essential hardware features that programmers can use when developing embedded device firmware System Collections System Diagnostics Microsoft SPOT Input Namespace l l System Globalization The Microsoft SPOT Input namespace in the Microsoft NET Micro Framework provides classes i delegates and enumerations that support the Windows Presentation Foundation WPF input System IO system System Net System Met Sockets System Reflection System Resources Microsoft SPOT Presentation Namespace 5 a time CompilerServi The Microsoft SPOT Presentation namespace in the Microsoft NET Micro Framework provides ystem Run de classes a structure and enumerations you can use to lay out and display graphical user interface System Runtime InteropServices GUI items such as window and its child elements on display device screen Se ke Microsoft SPOT Presentation Controls Namespac
49. w Project Build Debug Data Tools Window Community Help Hay e hg BB O h Debu Any CPU p SensorIT5400 0cs XSensorIT5400 X Application Configuration active Debug Platform active ony CPL General Conditional compilation symbols ALERT ENABLE M Define DEBUG constant 43 40 dx uonjoS Ra Build Events Debug Resources M Define TRACE constant Settings Platform target any CPU Allow unsafe code Reference Paths E Optimize code Micro Framework Errors and warnings fre Find Symbol Results Ready 6 5 1 XSensorlTS400 Light Pattern Light Pattern Green blinking once per second 6 5 2 XSensorlTS400 Packet Format Table 6 3 Header contents of an XSensorlTS400 message header XSensor packet type field XSensorlTS400 is always a constant value of 0x20 l XSensor packet sub type field k ene XSensorlTS400 is always a constant value of 0x01 uint16 t Network short address of sending node Table 6 4 Payload contents of an XSensorITS400 message Field Name Incrementing sequence number for yield calculation une em unmet acceix Accelerometer reading ol X axis uint16_t accel_y Accelerometer reading of Y axis umea accelz AccelerometerreadingofZais uint16_t temperature Temperature reading Doc 7430 0765 01 Rev A Page 25 Imote2 Builder Kit Manual Crossb w uint16 t temperature2 Temperature reading from Sensirion sensor uint16 t humidity
50. y Succeeded in Status message bar on the lower right hand side The Imote2 should begin blinking a blue LED at 1 Hz gt IMPORTANT When the Visual Studio is in Debug mode the USB port gets locked and not available for other applications such as MotePlot To release the USB port click on M stop button or select detach from the debug menu Upon resetting the Imote2 if the green LED does not switch off in 5 seconds the Imote2 cannot be flashed Check if the Imote2 is connected to any tool and close the tool Reset the Imote2 and try again If the green LED does not turn off in a few moments reboot your PC The current version of NET Micro Framework does not support more than one Imote2 connecting to PC via USB at the same time doing so will lead to strange behavior 4 3 Create your own NET Micro Framework application Visual Studio provides New Project wizard for users to start their projects the wizard can be invoked when users select File gt New gt Project in the VS 2005 menu The following screenshot shows the first step to create a NET Micro Framework application Micro Framework is selected as the project type Console Application is selected as the template Note that Window Application template is not supported in the current edition The users are recommended to select Console Application template for application project and Class Library for library project Doc 7430 0765 01 Rev A Page 15 Imote2 Builder Kit Manual C

Download Pdf Manuals

image

Related Search

Related Contents

Ecole Doctorale de Français Pôle Est Antenne Mentouri MEMOIRE  Gigabyte Akta A4 8GB Black, Blue  American Standard Copeland Deck-Mount Bath Filler 7005.901 User's Manual  

Copyright © All rights reserved.
Failed to retrieve file