Home
AVR2052: BitCloud Quick Start Guide
Contents
1. Table 9 4 J2 jumper settings for ZigBit Amp power source Jumper position Description J2 bridges pin 2 and pin ZigBit Amp is powered by USB 3 J2 bridges pin 2 and_ ZigBit Amp is powered by external DC source or by batteries if pin 1 external DC source is disconnected AMEL 25 8200H AVR 02 10 AMEL Table 9 5 J3 jumper settings for all MeshBean types Serial USB selection Jumper position Description J3 bridges central pin The board will use serial port available in the Expansion slot for and RS 232 pin connection to the host J3 bridges central pin The board will use USB for connection to the host and USB pin Warning Any other position of jumpers J2 and J3 or their omission may permanently damage the MeshBean boards 9 2 Programming the Boards 9 2 1 Setting Parameters 9 2 2 Programming AVR2052 At startup the software assigns the 64 bit MAC address to the device as follows If at compile time CS_UID parameter is set to 0 BitCloud attempts to load MAC address from a dedicated UID chip available on MeshBean board via 1 wire interface If there is no such UID then zero MAC address will be assigned to the device Note that for proper operation all nodes in the network shall have unique MAC address values Hence if address cannot be obtained automatically from external source separate firmware images shall be created for each device with unique CS_UID p
2. AMEL 9 Appendix A 3 ZigBit ZigBit Amp and ZigBit 900 Specifics 9 1 Getting Started 9 1 1 Required Hardware 9 1 2 Hardware Setup 9 1 3 System Requirements 22 AVR2052 Before installing and using the BitCloud SDK make sure that all necessary hardware is available for the kit you would like to use e ATZB DK 24 ATZB DK A24 or ATZB DK 900 o ATZB DK 24 contains ATZB EVB 24 B0 ATZB EVB 24 SMA ATZB EVB 24 A2 MeshBean evaluation board with mounted ZigBit modules o ATZB DK A24 contains ATZB EVB A24 UFL MeshBean Amp evaluation board with ZigBit Amp modules o ATZB DK 900 contains ATZB EVB 900 BO MeshBean 900 evaluation board with ZigBit 900 modules e JTAGICE mkIll No special pre usage assembly is required for MeshBean boards supplied with ZigBit Development Kits Please note that the boards can be powered in one of the three ways e bya pair of AA size batteries e via the USB port once connected for data transfer see also Section 9 1 4 e via an AC DC adaptor The nominal voltage is 3V for MeshBean and MeshBean 900 boards 3 3V for MeshBean Amp Using AC DC adaptor automatically disconnects AA batteries Using USB port disconnects the AC DC adaptor Before using the SDK please ensure that the following system requirements are met by your PC and development environment Table 9 1 System requirements for ZigBit ZigBit Amp and ZigBit 900 Parameter Value Note Intel Pentium III or higher CP
3. AVR2052 8 3 Pre Built Images The SDK comes with ready to use binary images of WSNDemo application There is a set of images for different device types 1 WSNDemoApp USB Coord hex for RZUSBSTICK AT90USB1287 controller acting as Coordinator 2 WSNDemoApp USB _Router hex for RZUSBSTICK AT90USB1287 controller acting as Router 3 WSNDemoApp Raven Router hex for AVRRAVEN ATmega1284p microcontroller acting as Router 4 WSNDemoApp Raven _EndDev hex for AVRRAVEN ATmega1284p microcontroller acting as End Device 5 Raven _3290P_LCD hex for AVRRAVEN s LCD controller ATmega3290p And SerialNet application 10 for RZUSBSTICK 6 SerialNet_USB hex In all ready to use binary images MAC address CS_UID is loaded automatically from a dedicated external EEPROM chip ensuring that unique MAC addresses are assigned to all network nodes Note that the default WSNDemo images are configured to use Extended PAN ID 0xAAAAAAAAAAAAAAAA and channel mask with only channel 0x0F enabled for operation 8 4 Running WSNDemo 8 4 1 Starting WSNDemo To start WSNDemo do the following Setup the hardware as described in Section 8 1 2 2 Install BitCloud SDK as described in Section 8 1 4 3 Load precompiled WSNDemo firmware images to devices a On RZUSBSTICK Coordinator WSNDemoApp USB Coord hex b On AVRRAVEN Router WSNDemoApp_ Raven Router hex for ATmegai284p microcontroller and Raven
4. AVR2052 As a result hex srec bin and elf application images will be generated 6 2 2 2 IAR Embedded Workbench e Command line Compile application by running make utility Before running make be sure that Configuration file has COMPILER_TYPE variable set to IAR The hex srec bin and elf image files will then be generated e IDE Open the eww file in the iar AVR for ZigBit RZRAVEN platforms subdirectory of the appropriate application directory for WSNDemo WSNDemo eww file from the Sample Applications WSNDemo iar AVR subdirectory with IAR Embedded Workbench and execute Rebuild A11 item from the Project menu By default the a90 for WSNDemo WSNDemo a90 file will be generated in the iar AVR Debug exe subdirectory for WSNDemo in Sample Applications WSNDemo iar AVR Debug exe directory with format as specified in Linker Output Options of the IAR project 6 3 Reserved Hardware Resources 8200H AVR 02 10 Hardware resources provided by the supported hardware include microcontroller peripherals buses timers IRQ lines I O registers etc Many of these interfaces have corresponding APIs in hardware abstraction layer HAL of the BitCloud stack When building custom applications on top of the BitCloud API the user is encouraged to use the high level APIs instead of the low level register interfaces to ensure that the resource use does not overlap with that of the stack
5. AVR2052 BitCloud Quick Start Guide Features Introduces BitCloud Software Development Kit SDK Introduces WSNDemo application 8 bit AVR Microcontrollers 1 Introduction Application Note This document is intended for engineers and software developers evaluating BitCloud ZigBee PRO stack BitCloud SDK and the supported kits serve as the perfect vehicle to evaluate the performance and features of Atmel microcontrollers and radio transceivers as devices in a wireless sensor network The SDK provides a complete software and documentation toolkit for prototyping developing and debugging custom applications on top of BitCloud s application programming interface API Rev 8200H AVR 02 10 AIMEL 2 References 2 AVR2052 1 2 3 4 5 6 7 8 9 10 1 12 13 14 15 16 17 18 19 20 AMEL AVR2051 BitCloud Stack Documentation AVR2050 BitCloud User Guide AVR Studio User Guide Available in HTML Help within the product WinAVR User Manual 20090313 Using the GNU Compiler Collection RZRAVEN Firmware Documentation AVR2017 RZRAVEN Firmware AVR2015 RZRAVEN Quick Start Guide AT91 USB CDC Driver Implementation 6269A ATARM 10 Oct 06 http www atmel com dyn resources prod_documents doc6269 pdf ZigBit Development Kit User s Guide http www meshnetics com downloads docs AVR205xX SerialNet User Guide Available in
6. Check that the device is correctly shown in the Device Manager window as on the figure below 8200H AVR 02 10 AVR2052 Figure 9 1 Correctly installed COM port for MeshBean device 2i pevice manager ST Fie Action View Help PSIA 44 ZigBitUser 9 Computer Disk dives Display adapters qS DVD CD ROM drives Aoppy disk controllers I Floppy disk drives yg Human Interface Devices S IDE ATA ATAPI controllers P Keyboards 2 Mice and other pointing devices Monitors B Network adapters A Ports COM amp LPT Communications Port COM1 CP210x USB to UART Bridge Controller COM3 F ECP Printer Port LPT1 M Processors Sound video and game controllers System devices Universal Serial Bus controllers SO SSS BHBOH BE S68 8 amp 6 Download and install Java Runtime Environment 12 if not already installed on your PC 9 1 5 Selected jumpers on MeshBean boards This section defines settings for some of the jumpers used on the MeshBean board For more information on jumper settings and interface pinouts refer to 9 Note that J2 settings differ for ZigBit ZigBit 900 and ZigBit Amp Table 9 3 J2 jumper settings for ZigBit and ZigBit 900 power source Jumper position Description J2 bridges POWER pin ZigBit is powered by primary source battery USB or AC DC and BAT pin adapter J2 bridges POWER pin ZigBit is powered by 3 6 V internal voltage regulator and DC DC pin
7. Figure 10 1 Contacts to be insulated on STK600 ATmega128RFA1 top card e 8200H AVR 02 10 AVR2052 2 Make sure jumper is present at pins as indicated by red arrow on Figure 10 2 Figure 10 2 Jumper setting for STK600 ATmega128RFA1 top card NR Assemble top card with STK600 board 4 Default output for USART interface is performed via PD2 PD3 pins In order to communicate over RS232 port they shall be connected to RXD and TXD pins of RS232 SPARE port respectively Before continuing any further operations perform the steps required to get started with ATSTK6000 15 Refer to AVR Studio Help 3 for details on that subject At least make sure that STK600 firmware is up to date and configure the voltage provided by STK600 for ATmega128RFA1 top card For that perform the following steps 10 1 3 System Requirements o pap f K6 AT megai28RFAi 6 ace Attach STK600 to PC using USB cable In AVR Studio open Tools gt Program AVR gt Connect dialogue Choose the right Platform STK600 and press Connect Update the STK600 firmware if suggested Go to HW Settings tab Specify the 3 3V in the VTarget field and press Write You need to perform this procedure only once for each ATSTK600 board Before using the SDK please ensure that the following system requirements are met by your PC and development environment Table 10 1 System requirements for Atmega128RFA1 Parame
8. The hardware resources reserved for the internal use by the stack in BitCloud are listed in platform specific sections specified in the table below These resources must not be accessed by the application code Please note that the lists of the reserved hardware resources differ for each device Table 6 3 Platform Specific Reserved Resources For Platform Refer to Section ATAVRRZRAVEN 8 5 ZigBit ZigBit Amp ZigBit 900 9 4 ATmega128RFA1 10 5 UC3 11 5 AMEL i 7 Basic Troubleshooting AVR2052 ATMEL In case of any operational problem with your setup please check the following 1 Check the power first and make sure that all of your equipment is properly connected 2 Check if your PC conforms to the minimum system requirements see Section 4 3 Check if the PC USB or UART interface is working and the correct drivers are installed see Section 4 Check hardware kit documentation if you have setup and are using the hardware in the right way See Section 4 for specific hardware setup requirements For ATAVRRZRAVEN check LCD indication of AVRRAVEN nodes to detect the cases when they are not responding or behaving unusually Make sure you have programmed the right images and set the correct Fuses values see Section 5 2 Resetting the node may be required The table below represents some typical problems that you may encounter while working with the Development Kit and possible solution
9. BitCloud SDK http www atmel com bitcloud AVR2054 Serial Bootloader User Guide Available in BitCloud SDK http www atmel com bitcloud Java Runtime Environment http java sun com javase downloads index jsp IAR Embedded Workbench for Atmel AVR http www iar com website1 1 0 1 0 107 1 ATmega128RFA1 a package Quick Start Guide ATSTK600 description http www atmel com dyn products tools_card asp tool_id 4254 Radio Extender Board REB231 V4 0 2 http www dresden elektronik de shop prod72 htm ATEVK1105 description http www atmel com evk1105 AVR82 UC3 Software Framework 1 5 0 http www atmel com dyn resources prod_documents AVR32 SoftwareFramework AT32UC3 1 5 0 zip AVR32 GNU Toolchain http www atmel com dyn products tools_card asp tool_id 4118 IAR Embedded Workbench for Atmel AVR32 http www iar com website1 1 0 1 0 124 1 8200H AVR 02 10 3 Overview AVR2052 BitCloud is a full featured professional grade embedded software ZigBee stack from Atmel The stack provides a software development platform for reliable scalable and secure wireless applications running on Atmel microcontrollers and radio transceivers BitCloud is designed to support a broad ecosystem of user designed applications addressing diverse requirements while enabling a full spectrum of software customization The following hardware platforms are supported by BitCloud SDK Table 3 1 Supported hardware platforms
10. Figure 3 1 Figure 3 1 BitCloud Block Diagram HB User application Em Core stack GB Shared low level services The topmost of the core stack layers APS provides the highest level of networking related API visible to the application ZDO provides a set of fully compliant ZigBee Device Object API which enable main network management functionality e g start reset formation join It also defines ZigBee Device Profile types device and service discovery commands implemented by the stack The general guidelines to developing applications with BitCloud are presented in 2 The SDK also includes WSN Monitor PC application in binary format and WSNDemo embedded application available in binary format and source code The source code for WSNDemo application can be modified and extended making it possible to develop WSN applications for a variety of application scenarios WSN Monitor and WSNDemo applications are described in detail in Section 5 For ZigBit ZigBit Amp ZigBit 900 and ATAVRRZRAVEN platforms the SDK also includes other reference applications as described in Section 6 2 1 This chapter describes how to quickly get BitCloud running on the selected hardware platform BitCloud SDK is available for several platforms as described in Section 2 Before proceeding select the SDK version that matches your target platform The majority of instructions for setting up BitCloud stack and applications depend on specific platform and ev
11. Name in This Document ATAVRRZRAVEN ZigBit ZigBit Amp ZigBit 900 megaRF UC3 Platform Supported Modules Supported Evaluation Appropriate SDK MCU RF Kit AT90USB1287 N A ATAVRRZRAVEN BitCloud for AT86RF230 consists of ATAVRRZRAVEN ATmegat2B4P ic ATmega3290P re AT86RF230 evices ATmega1281 ATZB 24 B0 ZigBit BO ATZB DK 24 ZDK BitCloud for ZDK AT86RF230 ATZB 24 A2 ZigBit A2 ATmegai281 ATZB A24 UFL ZigBit Amp ATZB DK A24 BitCloud for ZDK Amp AT86RF230 ZDK Amp ATmegai281 ATZB 900 B0 ZigBit 900 ATZB DK 900 ZDK 900 BitCloud for ZDK 900 AT86RF212 ATmega128RFA1 N A a package and BitCloud for megaRF ATmega128RFA1 card hosted on ATSTK600 AT32UC3A0512 N A EVK1105 BitCloud for AVR32 UC3 AT86RF231 8200H AVR 02 10 Please note that this document describes the use of BitCloud with the specific modules and evaluation kits listed in the table above Operation of BitCloud on supported MCU RF combinations realized in a custom hardware application is outside the scope of this document BitCloud stack is fully compliant with ZigBee PRO and ZigBee standards for wireless sensing and control It provides an augmented set of APIs which while maintaining full compliance with the standard offer extended functionality designed with developer s convenience and ease of use in mind AMEL s 4 Getting Started 4 AVR2052 AMEL The main structure of the BitCloud stack is presented in
12. applications where available the source code can be found in Sample Applications lt application name gt directories Network parameters and their default values are defined in Configuration file However when the application is compiled using IAR Embedded Workbench IDE the network parameters are defined in iarConfiguration h file located in iar AVR subdirectory of the appropriate application directory For the WSNDemo application this file is located in BitCloud Sample Applications WSNDemo iar AVR In all other cases including compiling from the command line using IAR compiler Configuration file will be used 6 2 2 Compiling Applications The following development environment options are available for each of the supported platforms Table 6 2 Platform Specific Compilation Options For Platform AVR Studio IAR Embedded WinAVR Workbench ATAVRRZRAVEN X X ZigBit ZigBit Amp ZigBit 900 X X megaRF X X UC3 xX In order to compile an application in each of the available development environments the following steps should be taken 6 2 2 1 AVR Studio WinAVR e Command line Compile application by running make utility Before running make be sure that Configuration file has COMPILER_TYPE variable set to GCC e IDE Open the aps file from the appropriate directory with AVR Studio and execute Build Rebuild A11 from the main menu 12 AVR2052 8200H AVR 02 10
13. automatically Upon starting every node informs the network on its role If you power on the coordinator it switches to an active state even though no child node is present This is normal and it indicates that the coordinator is ready and child nodes can join the network with the coordinator s extended PAN ID By default the coordinator uses extended PAN ID 0xAAAAAAAAAAAAAAAA which is recognized by all routers A short PAN ID is chosen at random The extended PAN ID can be modified by the user through the application Configuration file as described in Section 6 2 1 Note If the coordinator is absent or has not been turned on the routers and end devices will remain in the network search mode In this mode routers scan the channels specified in the channel mask in search of a network with the specified extended PAN ID By default the channel mask for all application images provided with SDK contains a single channel In rare cases if the frequency corresponding to the radio channel is busy the coordinator node may stay in the network search mode If this happens you should change the application s channel mask to select another channel by changing the application s Configuration file and recompiling the application as described in Section 6 2 1 WSN Monitor is a PC GUI application for WSNDemo that is used to display a ZigBee network topology and other information about a wireless sensor network A typical WSN Monitor screen is
14. coordinator to emulate sensor data and demonstrate data transmission End devices follow a duty cycle i e microcontroller and radio transceiver are put to sleep periodically waking up to transmit the data to the coordinator device Using the serial connection the coordinator transmits the received packets along with its own sensor data also Os for ATAVRRZRAVEN megaRF and UC3 to WSNMonitor application Those transmitted values are displayed on WSNMonitor panes as temperature light and battery level measurements Os for ATAVRRZRAVEN megaRF and UC3 WSN Monitor also visualizes the network topology by drawing a tree of nodes which have joined the network For each of the nodes the parameters like the node s address its node sensor information and link quality data are displayed Measured in dBm RSSI indicates a link s current condition The RSSI resolution is 3 dBm LQ is another numeric parameter defined within the 0 to 255 range to measure the link quality Larger values mean a better link while values close to zero indicate a poor connection In reference to WSNDemo application Section 5 3 describes how to setup and use the boards The user interface is described in Section 5 5 The application is delivered with source code which demonstrates how to develop a wireless network application using BitCloud API and provides a number of useful programming templates for common application tasks Development of custom applications i
15. files Makerules AtmlUsbDongle At90usb1287 8Mhz_ Iar and Makerules Raven _Atmegal284 4Mhz Iar the IAR_PATH variable points to the correct installation directory of IAR Embedded Workbench Update if needed 2 2 3 Add IAR Embedded Workbench bin directory for default installation located in C Program Files IAR Systems Embedded Workbench 5 3 avr bin to the system PATH environment variable To update the PATH variable go to Control Panel gt System gt Advanced gt Environment Variables select Path variable from the System variables list press Edit and append followed by the actual bin directory name to the end of the Variable 16 AVR2052 8200H AVR 02 10 AVR2052 value then press OK This step is required if you plan to build embedded images using IAR Embedded Workbench from command line 3 Install USB to Serial Converter driver To install the driver please attach the RZUSBSTICK device to your PC and wait for Windows to request for a specific driver for the device If the RZUSBSTICK already has an assigned driver or Windows assigned driver to it automatically go to Start Control Panel System Hardware Device Manager double click the RZUSBSTICK device and select Update Driver Choose the Install from a list or specific location option and point to 6119 inf provided with this SDK Please refer to section 4 9 1 of 8 for further det
16. the network coordinator and the WSN Monitor application running on the PC The messages sent on the serial connection are basically the messages defined in section 8 1 wrapped as defined below Table 13 1 Serial message format Offset 0 N 2 N 4 Length 2 bytes N bytes 2 bytes 1 byte Description Start sequence 0x10 0x02 Variable length payload the message received from end node or router or generated by the coordinator in the format described in section 8 All 0x10 bytes in this payload are duplicated to avoid confusion with Start sequence or End sequence End sequence 0x10 0x03 Checksum Sum of the bytes 0 N 3 mod 256 AMEL i AIMEL T O Headquarters Atmel Corporation 2325 Orchard Parkway San Jose CA 95131 USA Tel 1 408 441 0311 Fax 1 408 487 2600 International Atmel Asia Unit 1 5 amp 16 19 F BEA Tower Millennium City 5 418 Kwun Tong Road Kwun Tong Kowloon Hong Kong Tel 852 2245 6100 Atmel Europe Le Krebs 8 Rue Jean Pierre Timbaud BP 309 78054 Saint Quentin en Yvelines Cedex France Tel 33 1 30 60 70 00 Atmel Japan 9F Tonetsu Shinkawa Bldg 1 24 8 Shinkawa Chuo ku Tokyo 104 0033 Japan Tel 81 3 3523 3551 Fax 81 3 3523 7581 Fax 852 2722 1369 Fax 33 1 30 60 71 11 Product Contact Web Site http www atmel com Sales Contact www atmel com contacts Technical Support avr atmel com Literature Request ww
17. 8 2 The SDK file structure Directory File Description Documentation Documentation on BitCloud software Evaluation Tools WSNDemo Ready to use image files for evaluating Embedded WSNDemo Refer to section 8 3 5 2for the description of the images Evaluation Tools WSNDemo WSN WSN Monitor installer Monitor WSNMonitorSetup exe Evaluation Tools SerialNet Ready to use image file for SerialNet application Firmware can be used on ATAVRRZUSBSTICK only Refer to 10 for more information on SerialNet BitCloud Components Header files for BitCloud Stack BitCloud Components BSP Source header and library files for BitCloud BSP BitCloud Components BSP Source and header files for LCD controller RAVEN AT3290P firmware BitCloud lib Library files for BitCloud Stack Sample Applications Source files for sample applications Third Party Software 6119 inf USB to Serial Converter driver 2 Install desired IDE 2 1 For AVR Studio and WinAVR 2 1 1 Install AVR Studio 3 if not already installed on your PC 2 1 2 Install WinAVR development suite 4 if not already installed on your PC Be sure to install only the supported version of WinAVR as specified in Table 8 1 2 2 For IAR Embedded Workbench AVR 2 2 1 Install IAR Embedded Workbench for AVR 13 if not already installed on your PC 2 2 2 In SDK directory BitCloud lib make sure that in
18. App hex There is a set of images for different roles and with different MAC addresses that can be used for creating a small network e WSNDemoApp Coord 0x01 elf for node acting as Coordinator e WSNDemoApp Router 0x02 e1f for node acting as Router e WSNDemoApp EndDev_0x03 elf for node acting as End Device The table below specifies MAC addresses pre programmed in ready to use images Table 11 5 AT32UC3A0512 hosted on EVK1105 WSNDemoApp_ Coord_0x01 hex 0x0000000000000001 Coordinator WSNDemoApp_ Router_0x02 hex 0x0000000000000002 Router WSNDemoApp_EndDev_0x03 hex 0x0000000000000003 End device Note that the default images are configured to use Extended PAN ID OxAAAAAAAAAAAAAAAA and channel mask with only channel OxOF enabled for operation 11 4 Running WSNDemo 11 4 1 Starting WSNDemo To start WSNDemo do the following 15 Setup the hardware as described in Section 11 1 2 16 Install BitCloud SDK as described in Section 11 1 4 17 Program one device with coordinator image file and other with either router or end device images as described in Section 11 2 18 Connect the coordinator node to the PC using serial interface 19 Power on the coordinator node 20 Run WSN Monitor see Section 5 5 21 Power ON and reset the rest of the nodes 11 4 2 Monitoring WSNDemo Activity Network activity can be monitored in two ways e observing LEDs of the development boards as described in Table 11 6 LEDx label corresp
19. PIs contributed by these layers are outside the scope of core stack functionality However these essential additions to BitCloud API significantly reduce application complexity and simplify the development effort BitCloud Stack Documentation 1 provides detailed information on the stack s C API and its use The topmost of the core stack layers APS provides the highest level of networking related APIs visible to the application ZDO provides a set of fully compliant ZigBee Device Object APIs which enable main network management functionality e g start reset formation join ZDO also defines ZigBee Device Profile types device and service discovery commands implemented by the stack There are three service planes including task manager configuration manager and power manager These services are available to the user application and may also be utilized by lower stack layers Task manager is the stack scheduler which all multiple internal stack components and the user application to run on the same microcontroller The task manager utilizes a proprietary priority queue based algorithm specifically tuned for multi layer stack environment and demands of time critical network protocols Power management routines are responsible for gracefully shutting down all stack components and saving system state when preparing to sleep and restoring system state when waking up Configuration manager is used by both the internal stack components and th
20. Solder the JTAG headers onto the boards as described in 7 2 Make sure that the boards have fresh batteries Before using the SDK please ensure that the following system requirements are met by your PC and development environment Table 8 1 System requirements for ATAVRRZRAVEN Parameter CPU RAM Free space on hard disk JTAG emulator Operating system IDE Java Virtual Machine Notes Value Intel Pentium III or higher 800MHz 128MB 50MB JTAGICE mkll emulator with cable Windows 2000 XP AVR Studio 4 17 and WinAVR 20090313 OR IAR Embedded Workbench AVR 5 3 with IAR C C Compiler for AVR 5 30 6 Java Runtime Environment JRE 5 Update 8 or later Note Required to upload and debug firmware onto the boards through JTAG see Section 5 2 Required to upload firmware images through JTAG see Section 5 2 and to develop applications using API see Section 6 2 Required to run WSNMonitor application 1 2 Users are strongly recommended to use specified versions of WinAVR and IAR C C Compiler for AVR Other versions are not supported and may not work AMEL 15 AMEL 8 1 4 Installing the SDK Proceed with the following installation instructions 1 Download the archive to your PC and unpack it into an empty folder Make sure that path to this folder contains no blank spaces As a result the following SDK folders and files will be created Table
21. TMEL 11 Appendix A 4 UC3 Specifics 11 1 Getting Started 11 1 1 Required Hardware 11 1 2 Hardware Setup 11 1 3 System Requirements AVR2052 Before installing and using the BitCloud SDK for AVR32 UC3 make sure that all necessary hardware is available 1 Two or more EVK1105 boards 17 2 Two or more radio extender boards REB231 16 3 All necessary connectors 4 JTAGICE mkll To prepare the hardware 1 Install J12 and J16 extension headers on the board if not already installed 2 Install JTAG pin header on the board if not already installed 3 Use several 2 wire cables to connect J16 pins to corresponding pins on REB231 boards as indicated in Table 11 1 Table 11 1 EVK1105 to Radio Extender Board REB231 pin mapping EVK1105 J16 pin gt ojoj aojaj A Jojn REB231 pin 30 29 28 27 38 26 25 22 20 Before using the SDK please ensure that the following system requirements are met by your PC and development environment Table 11 2 System requirements for UC3 Parameter CPU RAM Free space on hard disk Value Intel Pentium III or higher 1GHz 512MB 200MB Note 8200H AVR 02 10 Parameter Value JTAGICE mkll emulator with cable Windows 2000 XP IAR Embedded Workbench AVR32 with IAR C C Compiler for AVR32 5 20 1 and AVR32 GNU Toolchain v2 3 JTAG emulator Operating system IDE Java Runtime Environment JRE 5 J
22. U 800MHz RAM 128MB Free space on hard disk 50MB Required to upload and debug firmware onto the boards through JTAG see Section 5 2 JTAGICE mkll emulator with cable Windows 2000 XP JTAG emulator Operating system 8200H AVR 02 10 AVR2052 Parameter Value Note AVR Studio 4 17 and Required to upload firmware WinAVR 20090313 images through JTAG see OR Section 5 2 and to develop applications using API see IAR Embedded Section 6 2 Workbench AVR 5 3 with IAR C C Compiler IDE for AVR 5 30 6 Java Runtime Required to run WSNMonitor Environment JRE 5 application Java Virtual Machine Update 8 or later Notes 1 2 Users are strongly recommended to use the specified version of WinAVR and IAR C C Compiler for AVR Other versions are not supported and may not work 9 1 4 Installing the SDK Proceed with the following installation instructions 1 Download the archive to your PC and unpack it into an empty folder As a result the following SDK folders and files will be created Table 9 2 The SDK file structure Directory File Description Documentation Documentation on BitCloud software Bootloader Contains Serial bootloader image file and installer for PC Evaluation Tools WSNDemo Ready to use image files for evaluating Embedded WSNDemo Refer to section 9 3 for the description of the images Evaluation Tools WSNDemo WSN WSN Moni
23. WSNDemo message format Field Name Length Description Message Type 1 byte Type of the messages Must be 0x01 0x01 is the only supported message type for the current revision of WSNDemo Node type 1 byte Type of the sending node 0 coordinator 1 router 2 end device IEEE address 8 bytes IEEE address of the sending node Short address 2 bytes Short address of the sending node Version 4 bytes Version of WSNDemo application protocol used by the sending node Currently set to 0x01010100 Channel mask 4 bytes Channel mask set on the sending node PANID 2 bytes PAN ID of the network to which the sending node is attached Channel 1 byte The channel on which the sending node operates Parent address 2 bytes Short address of the parent node Lal 1 byte LQI observed by the node that sends this message RSSI 1 byte RSSI observed by the node that sends this message lt Additional lt Variable gt Optional additional fields see description below in section fields gt 12 2 The message may contain zero one or more additional fields that follow the mandatory fixed width fields described in the table above The order of the additional fields is not fixed The size of the additional fields may vary each field contains a sub field defining its size Below is the description of the general format of an additional field Table 12 2 Additional field format Sub Field Name Length Description AMEL n AVR2052 AMEL Sub F
24. _3290P_LCD hex for ATmega3290p LCD controller the board contains two JTAG headers refer to 6 c On AVRRAVEN End Device WSNDemoApp Raven _EndDev hex for ATmegai1284p microcontroller and Raven _3290P_LCD hex for ATmega3290p LCD controller the board contains two JTAG headers refer to 6 Plug in the coordinator USB stick into PC 5 Run WSN Monitor see Section 5 5 6 Power ON the rest of the nodes 8 4 2 Monitoring WSNDemo Activity Network activity can be monitored in two ways AMEL i 8200H AVR 02 10 AVR2052 ATMEL e observing the LCD screens of AVRRAVEN devices and color LEDs of RZUSBSTICK devices see meaning of LCD information and LEDs described in the tables below e viewing the network information through the WSN Monitor installed on PC Table 8 6 LCD indication for AVRRAVEN boards used in WSNDemo Node State Searching for network Joined to network receiving data sending data Sleeping end device only Visual Information on LCD Screen JOINING string displayed red LED blinking sun symbol displayed ROUTER or ENDDEV string displayed depending on the node role red LED is on sun symbol displayed RX indicator visible please note the limitations due to LCD refresh rate TX indicator visible please note the limitations due to LCD refresh rate Red LED is off moon symbol displayed Table 8 7 LED indicat
25. able the BOOTRST option CKDIV8 Enabled CKOUT Disabled SUT_CKSEL Int RC Osc Start up time 6 CK 65 ms Make sure the following hex values appear in the bottom part of Fuses tab OxFE Ox9D 0x62 If the node is to be programmed with the use of Serial Bootloader enable additionally the BOOTRST option Make sure the following hex value string appears at the bottom of Fuses tab OxFE Ox9C 0x62 The SDK comes with the following ready to use binary images that can be used on STK600 or RCB128RFA1 boards e WSNDemoApp Coord hex WSNDemoApp Coord srec for Coordinator node e WSNDemoApp Router hex WSNDemoApp Router srec for Router nodes e WSNDemoApp EndDev hex WSNDemoApp EndDev srec for End Device nodes These hex files should be loaded using JTAG while srec files can be flashed using Serial Bootloader In all ready to use binary images MAC address CS_UID is loaded automatically from a dedicated external EEPROM chip ensuring that unique values are assigned to all network nodes Note that the default WSNDemo images are configured to use Extended PAN ID 0xAAAAAAAAAAAAAAAA and channel mask with only channel 0x0F enabled for operation 8200H AVR 02 10 10 4 Running WSNDemo 10 4 1 Starting WSNDemo To start WSNDemo do the following Setup the hardware as described in Section 10 1 2 Install BitCloud SDK as described in Section 10 1 4 Program one device with c
26. ails and basic troubleshooting options 4 Download and install Java Runtime Environment 12 if not already installed on your PC 8 2 Programming the Boards 8 2 1 Setting Parameters 8 2 2 Programming 8200H AVR 02 10 At startup the software assigns the 64 bit MAC address to the device as follows If at compile time CS_UID parameter is set to 0 BitCloud attempts to load MAC address from an external EEPROM chip available on RZRAVEN and RZUSBSTICK boards If there is no such UID then zero MAC address will be assigned to the device Note that for proper operation all nodes in the network shall have unique MAC address values Hence if address cannot be obtained automatically from external source separate firmware images shall be created for each device with unique CS_UID parameter specified in application configuration see Section 116 2 1 every time an image is compiled Refer to AVR Studio 3 and IAR Embedded Workbench 13 documentation for the description of how the images can be programmed to the boards using JTAG Set the following options in the Fuses tab before uploading the image through JTAG Note the values differ for different types of boards Table 8 3 Fuse bits setting for AT90USB1287 RZUSBSTICk Option Value BODLEVEL Brown out detection at VCC 2 4 V HWBE Disabled OCDEN Disabled JTAGEN Enabled SPIEN Enabled WDTON Disabled EESAVE Disabled BOOTSZ Boot Fla
27. aluation kit To get started proceed to the platform specific sections listed below Table 4 1 Hardware Specific Getting Started Sections For Platform Refer to Section ZigBit ZigBit Amp ZigBit 900 8200H AVR 02 10 AVR2052 For Platform Refer to Section UC3 11 1 After completing the installation try running WSNDemo application by programming the devices with ready to use images as described in Section 5 2 Finally Section 5 5 describes how to get started creating new or modifying existing applications based on BitCloud C API 5 WSNDemo Application 5 1 Overview 8200H AVR 02 10 The network and radio frequency performance of the hardware components is demonstrated with WSNDemo application which is based on BitCloud API This application consists of the embedded firmware which supports functions for coordinator router and end device and the GUI visualization application WSN Monitor which is run on a PC In WSNDemo the nodes communicate based on a proprietary messaging protocol With WSNDemo application installed the devices are organized into a set of nodes forming a ZigBee PRO network For ZigBit ZigBit Amp ZigBit 900 platforms end devices and routers and the coordinator read the sensor data from on board light and temperature sensors and forward collected data to WSN Monitor application for visualization On ATAVRRZRAVEN megaRF and UC3 platforms zero values are sent to the network
28. arameter specified in application configuration see Section 116 2 1 every time an image is compiled An image file can be uploaded into the boards in one of two ways using Serial Bootloader utility or in AVR Studio using JTAG emulator Be careful selecting the method of the node programming Each of MeshBean boards provided as a part of ZDK come with the bootstrap uploaded onto the ZigBit s microcontroller which is needed to run Serial Bootloader Using a JTAG to program the microcontroller will erase the bootstrap making the loading of application images with Serial Bootloader inoperable until the bootstrap is restored To program a board using Serial Bootloader perform the following steps 1 Connect MeshBean to the PC via USB or serial port depending on the position of jumper J3 see Section 9 1 5 2 Run Serial Bootloader In command line or in GUI specify the image file as WSNDemo srec and the COM port See 11 3 Press reset button on the board If a node has been configured as end device and it is currently controlled by an application the node should be powered off before reprogramming 4 Release reset button on the board Serial Bootloader expects that the button will be released within approximately 30 seconds If this does not happen the booting process will terminate 5 Serial Bootloader indicates the operation progress Once an upload is successfully completed the board would restart automatically If an up
29. ate sections in Table 5 2 for how MAC addresses are assigned for each type of supported boards Typically there is a number of pre compiled images provided with the SDK that can be used right away without any modification ZigBit ZigBit Amp ZigBit 900 ATAVRZRAVEN platforms do not require manual assignment of MAC addresses as the evaluation boards are equipped with a dedicated unique ID chip which BitCloud stack uses automatically on start up ATAVRRZRAVEN boards include an external EEPROM chip with an embedded unique ID which is also used by BitCloud automatically on start up Also note that the default images are configured to use a particular extended PAN ID and channel mask To change those parameters you must also modify the Configuration file and rebuild the application All and all special care must be taken by the user when configuring an application so that each compiled image contains a unique MAC address and all images share the same extended PAN ID The details of running WSNDemo differ for each target platform Please refer to an appropriate section listed in the table below for the platform specific instructions 8200H AVR 02 10 5 4 Network Organization 5 5 WSN Monitor 8200H AVR 02 10 AVR2052 Table 5 3 Platform Specific WSNDemo Sections For Platform Refer to Section ATAVRRZRAVEN 8 4 ZigBit ZigBit Amp ZigBit 900 9 4 megaRF 10 4 UC3 0 The coordinator organizes the wireless network
30. ava Virtual Machine Update 8 or later AVR2052 Note Required to upload and debug firmware onto the boards through JTAG see Section 5 2 Required to upload firmware images through JTAG see Section 5 2 and to develop applications using API see Section 6 2 AVR32 GNU Toolchain is only needed to install USB VCP driver Required to run WSNMonitor application Notes 1 Users are strongly recommended to use specified versions of IAR C C Compiler for AVR Other versions are not supported and may not work 11 1 4 Installing the SDK Proceed with the following installation instructions 1 Download the archive to your PC and unpack it into an empty folder with no blank spaces present in the directory path As a result the following SDK folders and files will be created Table 11 3 The SDK file structure Directory File Description Documentation Documentation on BitCloud software Evaluation Tools WSNDemo Embedded Ready to use image files for evaluating WSNDemo Refer to section 0 for the description of the images Evaluation Tools WSNDemo WSN Monitor Contains WSN Monitor installer BitCloud Components Header files for BitCloud Stack BitCloud Components BSP BSP Source header and library files for BitCloud BitCloud lib Library files for BitCloud Stack Sample Applications Source files for sample applicatio
31. components in applications intended to support or sustain life 2009 Atmel Corporation All rights reserved Atmel logo and combinations thereof AVR and others are the registered trademarks or trademarks of Atmel Corporation or its subsidiaries Other terms and product names may be trademarks of others 8200H AVR 02 10
32. ddress values Hence if address cannot be obtained automatically from external source separate firmware images shall be created for each device with unique CS_UID parameter specified in application configuration see Section 116 2 1 every time an image is compiled An image file can be uploaded into the boards in one of two ways using Serial Bootloader utility or using JTAG emulator Programming a board using Serial Bootloader requires that bootstrap is loaded to the device via JTAG For RCB128RFA1 with RCB breakout board Bootloader_ATmega128RFA1_RCB_BB hex image file shall be flashed via JTAG For STK600 Bootloader hex file shall be loaded to ATmega128RFA1 In both cases in the fuse bit configuration provided in Table 10 3 BOOTRST should be enabled If bootstrap is loaded following steps should be executed to upload the application image file to the board 1 Assemble board and connect it to PC a For RCB128RFA1 i Assemble RCB128RFA1 and RCB Breakout boards RCB_BB together ii Connect RS232 interface cable to J1 extender on RCB_BB and COM1 port on the PC b For STK600 i Assemble STK600 board and ATmega128RFA1 top card as described in Section 10 1 2 ii Connect PC COM1 port to RS232 SPARE port 2 Run Serial Bootloader application on the PC In command line or in GUI specify the srec image file and the COM port See 11 3 Perform HW reset on the board if requested Serial Bootloader expects that the reset will b
33. e bottom of Fuses tab OxFF Ox9C 0x62 By default each of the boards coming in ZDKs is preprogrammed with this fuse setting The SDK comes with the ready to use binary images in hex and elf formats for programming using JTAG and in srec format if using Serial Bootloader 11 e ZigBit ZigBit Amp o WSNDemo application WSNDemoApp o SerialNet application 10 SerialNet e For ZigBit 900 o WSNDemo application WSNDemoApp US WSNDemoApp EU and WSNDemo_China with specific settings for indicated regional regulatory requirements o SerialNet application 10 SerialNet AMEL 7 ATMEL The ready to use binary images retrieve MAC address automatically from UID ensuring that unique MAC addresses are assigned to all network nodes Also note that the default WSNDemo application images are configured to use Extended PAN ID 0xAAAAAAAAAAAAAAAA and channel mask with e channel 0x0F enabled for ZigBit and ZigBit Amp WSNDemoApp e channel 0x00 and channel page 0 WSNDemoApp EU or channel 0x01 and channel page 0 WSNDemoApp_ US for ZigBit 900 e channel 0x01 and channel page 5 WSNDemoApp_ China for ZigBit 900 9 3 1 Starting WSNDemo To start WSNDemo do the following e Setup the hardware as described in Section 9 1 2 e Install BitCloud SDK as described in Section 9 1 4 e Program devices as described in section 9 2 e Configure one single node as a coordinator and make th
34. e done within 30 seconds If this does not happen the booting process will terminate 4 Serial Bootloader indicates the operation progress Once upload is successfully completed the board would restart automatically If an upload fails Serial Bootloader would indicate the reason In rare cases booting process can fail due to the communication errors between the board and the PC If this happened attempt booting again If booting fails the program written to the board recently would be corrupted but the board can be reprogrammed again as the bootstrap should remain intact Refer to 14 and 15 for the description of how the images can be programmed to corresponding development boards using JTAG AMEL s3 10 3 Pre Built Images AVR2052 AMEL ey gt Note that using a JTAG to program the microcontroller will erase the bootstrap if present thus loading of application images with Serial Bootloader will become inoperable until the bootstrap is loaded to ATmega128RFA1 again Set the following options in the Fuses tab before uploading the image through JTAG Table 10 3 Fuse bits setting for ATmega128RFA1 Option Value BODLEVEL Brown out detection at VCC 1 8 V OCDEN Disabled JTAGEN Enabled SPIEN Enabled WDTON Disabled EESAVE Disabled BOOTSZ Boot Flash size 1024 words start address FC00 BOOTRST Disabled If the node is to be programmed with the use of Serial Bootloader en
35. e image files for evaluating WSNDemo Refer to section 0 for the description of the images Evaluation Tools WSNDemo WSN Monitor WSNMonitorSetup exe WSN Monitor installer BitCloud Components Header files for BitCloud Stack BitCloud Components BSP Source header and library files for BitCloud BSP BitCloud lib Library files for BitCloud Stack Sample Applications Source files for sample applications 2 Install AVR Studio 3 if not already installed on your PC Be sure to install only the supported version of AVR Studio as specified in Table 10 1 3 Install WinAVR development suite 4 if not already installed on your PC Be sure to install only the supported version of WinAVR as specified in Table 10 1 4 Download and install Java Runtime Environment 12 if not already installed on your PC 8200H AVR 02 10 AVR2052 10 2 Programming the Boards 10 2 1 Setting Parameters 10 2 2 Programming 8200H AVR 02 10 At startup the software assigns the 64 bit MAC address to the device as follows If at compile time CS_UID parameter is set to 0 BitCloud attempts to load MAC address from a dedicated external EEPROM chip available on RCB128RFA1 as well as on Atmega128RFA1 top card via SPI interface If there is no such chip then zero MAC address will be assigned to the device Note that for proper operation all nodes in the network shall have unique MAC a
36. e others be routers and end devices see Section 9 3 2 Any of the boards provided can be configured with any role e Connect the coordinator node to the PC using USB port on the coordinator board e Power on the coordinator node e Run WSN Monitor see Section 5 5 e Power ON and reset the rest of the nodes 9 3 2 Node Role Configuration The role of the node coordinator router or end device is configured using DIP switches on MeshBean board Table 9 7 DIP switches configurations on MeshBean boards used in WSNDemo DIP Switches Selected Role 1 3 ON OFF Coordinator OFF OFF Router OFF ON End Device 9 3 3 Monitoring WSNDemo Activity Network activity can be monitored in two ways e observing color LEDs of MeshBean boards see the table below e viewing the network information through WSN Monitor installed on PC Table 9 8 LED indication for MeshBean boards used in WSNDemo LED1 Red LED2 Yellow LED3 Green receiving data Blinking 28 AVR2052 8200H AVR 02 10 AVR2052 sending data to UART Blinking coordinator only Sleeping end device only 9 4 Reserved Hardware Resources Table 9 9 Hardware resources reserved by the stack on ZigBit ZigBit Amp and ZigBit 900 modules Resource Description 8 MHz from internal RC oscillator or external radio Processor main clock frequency SPI Radio interface ATmega ports PBO PB1 PB2 PB3 PB4 PA7 PE5 Radio interface ATmega
37. e user application alike to provide a common way to store and retrieve network parameters like Extended PAN ID and channel mask The Hardware Abstraction Layer HAL includes a complete set of APIs for using on module hardware resources e g EEPROM app sleep and watchdog timers as well as the reference drivers for rapid design in and smooth integration with a range of external peripherals e g IRQ TWI SPI UART 1 wire where hardware interface is supported by the platform Board support package BSP includes a complete set of drivers for managing standard peripherals e g sensors UID chip sliders and buttons placed on development boards such as those provided with ZigBit ZigBit Amp and ZigBit 900 evaluation kits Please refer to 1 and 2 for a more detailed description of the BitCloud API and its features Development tools consist of 1 a integrated development environment e g AVR Studio or IAR Embedded Workbench where sample applications may be modified compiled and debugged 2 a corresponding compiler tool chain e g WinAVR IAR which provides everything necessary to compile application source code into binary images and 3 a programming device e g JTAG which may be used to program and debug the application on a target platform 8200H AVR 02 10 6 2 1 Sample Applications 8200H AVR 02 10 WSNDemo Featured SDK application Blink Introduces the simplest application X X Lowpower Show how to col
38. elect Path variable from the System variables list press Edit and append followed by the actual bin directory name to the end of the Variable value then press OK This step is required if you plan to build embedded images using IAR Embedded Workbench from command line The board can be connected to host PC via USB port using USB 2 0 A mini B cable USB is a familiar connection option Furthermore it provides the convenient way to link multiple boards to a single PC and no battery is required once a board is powered via USB Alternatively the board can be connected to host PC via serial port using a serial cable Please note that USB and serial port RS 232 share the same physical port on the board They cannot be used at the same time Keep in mind that the connection mode is controlled by setting of jumper on a MeshBean Refer to Section 9 3 for the description of connectors and jumpers on MeshBean boards If you plan to use USB connection install USB to UART Bridge VCP driver To install the driver please do the following 1 Download the driver from https www silabs com products mcu Pages USBtoUARTBridgeVCPDrivers aspx 2 Attach the MeshBean board to the USB port of your PC Windows should detect the new hardware Follow the instructions provided by the driver installation wizard 3 Make sure that the driver is installed successfully and the new COM port is present in the device list
39. from existing project for IAR Embedded Workbench for AVR32 can be uploaded into the boards using JTAG emulator as follows 7 Assemble board and connect it to PC 8 Connect JTAG to UC3A JTAG header Power on the board and JTAG ICE mkll 9 Start IAR Embedded Workbench for AVR32 10 From File gt Open gt Workspace navigate to and open desired IAR project e g WSNDemoApp eww file in Sample Applications WSNDemo iar avr32 folder 11 Select Project gt Download and Debug 12 Once the firmware is loaded select Debug gt Stop Debugging 13 Unplug JTAG from UC3A JTAG header 14 Reset EVK1105 Alternatively it is possible to load ready image file in elf format using AVR382 GNU Toolchain 19 by running following command in console avr32program program finternal 0x80000000 256Kb cxtal e v O0x80000000 lt filename elf gt Make sure the following fuse options in JTAGICE mkII gt Fuse handler menu of IAR Embedded Workbench for AVR32 are set Table 11 4 Fuse bits setting for AT32UC3A0512 Option Value BODLEVEL Brown out detection at VCC 1 92 V 63 BODHYST Enabled 1 BODEN Disabled 3 LOCKO LOCK15 Unlocked 1 EPFL External instruction fetch enabled 1 BOOTPROT No bootloader 7 8200H AVR 02 10 AVR2052 Option Value GF29 1 GF30 1 GF31 1 11 3 Pre Built Images The SDK comes with ready to use binary images of WSNDemo application WSNDemo
40. he network nodes and between the coordinator and the PC the user can refer to Section 12 and Section 13 For some platforms additional sample applications are available as indicated in the table below Table 6 1 Sample Applications Availability Application Brief Description ATAVRRZR ZigBit Amp ZigBit 900 AVEN ZigBit x megaRF x UC3 x lt x lt demonstrating network functionality of software and additional network visualization with WSN Monitor See section 5 that uses timer and LEDs When started the application makes all the LEDs blink synchronously with a certain period power sleeping devices employing the simplest power management strategy simplest peer to peer link A simple buffering strategy is employed to avoid byte by byte data transfer AMEL n ATMEL Application Brief Description ATAVRRZR AVEN ZigBit ZigBit Amp ZigBit 900 megaRF UC3 x lt PingPong Shows how process multiple simultaneous data transmissions Each node is waiting for a wireless message and then passes it to the next node ThroughputTest Measures wireless UART bandwith X X of ZigBit ZigBit Amp and ZigBit 900 boards For more details on sample applications available for a specific platform refer to 1 Once the SDK is installed the source code for the WSNDemo application can be found inside the Sample Applications WSNDemo directory For other sample
41. hort address is set back as node s title 5 5 1 Setting up node timeouts The Window Preferences menu of WSN Monitor contains a number of parameters used to control application behavior Timeouts are used to tune visualization of coordinator routers and end devices as the nodes disappear from the network each time a connection is lost power is down or a reset has occurred A node timeout corresponds to the time the WSN Monitor application waits for a packet from a node before assuming that a node is no longer part of the network Note that this value does not correspond to the frequency with which data is transmitted by 8 AVR2052 8200H AVR 02 10 5 5 2 Sensor data visualization 8200H AVR 02 10 AVR2052 each type of device To get smooth topology visualization setting timeouts to 20 sec is recommended for coordinator and router and 30 sec is recommended for end device Assuming default application configuration these timeouts cover 3 periods between sending a packet so at least 3 packets would need to be lost before a node is removed from WSN Monitor s Topology Pane Figure 5 2 WSNMonitor Preferences menu Preferences E WSNDemo D WSNDemo Cy WSNDemoNode oter eres Coordinator timeout rm End device timeout N Each of the boards sends temperature light battery sensors readings or emulated values to the coordinator which in turn sends it to the PC The WSN Monitor allows to di
42. ield Name Length Description Type of the additional field The possible values are listed Field Type 1 byte below Size of the Field Data in bytes Note this size does not Field Size 1 byte include the Field Type and Field Size sub fields The data depend on the Field Type the size of the data is Field Data lt Variable gt provided by the Field Size The following types of additional fields are defined Table 12 3 Additional field types Sensors data for board type 1 Used for ATAVRRZRAVEN kit boards 0x01 and MeshBean boards 0x20 Node name Please note that in the current version of WSNDemo devices send additional fields of type 0x01 sensors readings for boards of type 1 only Unrecognized additional fields are discarded by WSN Monitor application The Field Data format for different field types are described in the following tables Table 12 4 Field Data for type 0x01 Sensors data for board type 1 Offset Length Data Type Description 0 4 bytes Unsigned int Battery status reading 4 4 bytes Unsigned int Temperature sensor reading 8 4 bytes Unsigned int Light sensor reading Table 12 5 Field Data for type 0x20 Node name Offset Length Description 0 lt Variable gt Zero terminated ASCII string 8200H AVR 02 10 13 Appendix B 2 Serial Protocol 8200H AVR 02 10 AVR2052 This appendix describes the protocol and message format used over the serial connection between
43. ion for the Node State Powered on Searching for network Joined to network receiving data sending data to ZigBee network routers and end devices only sending data to USB coordinator only Sleeping RZUSBSTICK devices used in WSNDemo LEDs indication Blue LED is on Red LED blinking Red LED is on Yellow LED Green LED Green LED Not supported for RZUSBSTICK 8 5 Reserved Hardware Resources Table 8 8 Hardware resources reserved by the stack on RZUSBSTICK devices Resource Processor main clock SPI AT90USB1287 ports PBO PB1 PB2 PB3 PB4 PB5 PB7 PD4 Timer Counter3 Timer Counter1 capture input Timer Counter1 Description 8MHZz oscillator with external quartz Radio interface Radio interface Radio interface Radio interface System timer 8200H AVR 02 10 8200H AVR 02 10 AVR2052 Table 8 9 Hardware resources reserved by the stack on AVRRAVEN devices Resource Processor main clock SPI ATmega ports PBO PB1 PB3 PB4 PB5 PB6 PB7 PD6 ATmega ports PC6 PC7 Timer Counter2 Timer Counter3 Timer Counter1 Timer1 ICP IRQ EEPROM Description 4 or 8MHz from internal RC oscillator or external radio frequency Radio interface Radio interface Asynchronous timer interface Asynchronous timer Radio interface System timer Radio interface Storage for user settings accessible via Persistent Data Server ANMEL 21 m G
44. lect data from low X X Peer2peer Shows how to organize the X X AVR2052 Atmel s AVR Studio 3 and or IAR Embedded Workbench for Atmel AVR 13 may be used to develop and debug applications based on BitCloud API on AVR based platforms including ZigBit ZigBit Amp ZigBit 900 and ATAVRRZRAVEN This IDE supports editing of application source code compilation linking object modules with libraries and application debugging AVR Studio is integrated with WinAVR a Windows port of GNU compiler tool chain for the Atmel AVR microprocessors More information about WinAVR and GNU compiler tools is available in 4 and 5 In AVR Studio each application has a corresponding project file identified by the aps extension All the necessary information about a project is contained in the project file which can be double clicked to open the application s project in AVR Studio Likewise In IAR Embedded Workbench each application has a corresponding eww file which can be double clicked to open the application s project For detailed instructions on how to compile and debug applications using the supported tools refer to Section 6 2 2 Platform specific sections which describe development tools installation and setup instructions are listed in Table 4 1 For all platforms the SDK is supplied with WSNDemo sample application provided in source code WSNDemo is presented in detail in Section 5 To better understand the communication between t
45. load fails Serial Bootloader would indicate the reason In rare cases booting process can fail due to the communication errors between the board and the PC If this happened attempt booting again or try using conventional serial port instead of 8200H AVR 02 10 AVR2052 USB If booting fails the program written to the board recently would be corrupted but the board can be reprogrammed again as the bootstrap should remain intact Refer to AVR Studio documentation for the description of how the images can be programmed to the boards using JTAG Set the following options in the Fuses tab before uploading the image through JTAG Table 9 6 Fuse bits setting for ZigBit ZigBit Amp ZigBit 900 9 3 Pre Built Images 8200H AVR 02 10 Option Value BODLEVEL Brown out detection disabled OCDEN Disabled JTAGEN Enabled SPIEN Enabled WDTON Disabled EESAVE Disabled BOOTSZ Boot Flash size 1024 words start address FC00 BOOTRST Disabled If the node is to be programmed with the use of Serial Bootloader enable the BOOTRST option CKDIV8 Enabled CKOUT Disabled SUT_CKSEL Int RC Osc Start up time 6 CK 65 ms Make sure the following hex values appear in the bottom part of Fuses tab OxFF Ox9D 0x62 If the node is to be programmed with the use of Serial Bootloader enable additionally the BOOTRST option Make sure the following hex value string appears at th
46. ns 2 Install IAR Embedded Workbench for AVR32 20 if not already installed on your PC Be sure to install only the supported version of IAR Embedded Workbench as specified in Table 11 2 3 Install AVR32 GNU Toolchain 19 if not already installed on your PC 4 Download and install Java Runtime Environment 12 if not already installed on your PC 5 Install USB VCP driver on EVK1105 to allow it to communicate with your PC a Connect JTAG to UC3B JTAG header and power on the board AMEL 8200H AVR 02 10 37 AMEL b From Third Party Software EVK1105 UC3B_VCP run program _evk1105 at32uc3b isp cdc 1 0 1 cmd Windows command script c VCP driver should now be installed on the board 6 Attach EVK1105 board to the USB port of your PC using USB 2 0 A mini B cable Windows should detect the new hardware Follow the instructions provided by the driver installation wizard When prompted choose to install the driver from the specific location and select the driver located in Third Party Software folder of the SDK 11 2 Programming the Boards 11 2 1 Setting Parameters 11 2 2 Programming AVR2052 For proper operation all nodes in ZigBee network shall have unique MAC address values For UC3 a unique CS_UID parameter must be specified for each node in the application configuration see details in Section 6 2 1 and then the application image must be built separately for each board An image file
47. onds to EVK1105 board e viewing the network information through WSN Monitor installed on PC see Section 5 5 Table 11 6 LED indication for WSNDemo application on EVK1105 board AMEL s 8200H AVR 02 10 AMEL Node State Searching for network Joined to network receiving data sending data to UART coordinator only Sleeping end device only LEDO Blinking ON OFF OFF LED1 Blinking OFF LED2 OFF Blinking OFF 11 5 Reserved Hardware Resources Table 11 7 Hardware resources reserved by the stack on AT32UC3A0512 AVR2052 Resource Processor main clock AVR32 ports A9 A20 A11 A12 A13 Timer Channel 0 AVR32 port B30 B31 Description 48 MHz from external quartz Radio interface Timer Sleep reset 8200H AVR 02 10 AVR2052 12 Appendix B 1 Over the Air Protocol 12 1 Message Format 12 2 Additional fields 8200H AVR 02 10 This appendix describes the protocol used by the WSNDemo sample application The description includes the format of the messages exchanged over the air between the connected nodes The protocol description allows non standard nodes e g those using 3 party sensors not available on the standard evaluation boards and kits to transfer sensor readings and have them visualized in the same WSN Monitor application End devices and routers send messages to the coordinator using the following format Table 12 1
48. oordinator image file and other with either router or end device images as described in Section 10 2 Connect the coordinator node to the PC using serial interface Power on the coordinator node Run WSN Monitor see Section 5 5 Power ON and reset the rest of the nodes 10 4 2 Monitoring WSNDemo Activity Network activity can be monitored in two ways AVR2052 e observing LEDs of the development boards as described in Table 10 4 LED Dx label corresponds to RCB128RFA1 board and color label to STK600 board e viewing the network information through WSN Monitor installed on PC see Section 5 5 Table 10 4 LED indication for RCB128A1 boards used in WSNDemo Node State Searching for network Joined to network receiving data sending data to UART coordinator only Sleeping end device only ON OFF LED D2 red Blinking LED D3 yellow OFF Blinking OFF OFF OFF LED D4 green Blinking 10 5 Reserved Hardware Resources Table 10 5 Hardware resources reserved by the stack on Atmega128RFA1 Description Resource Processor main clock TRX24 ATmega ports PG3 PG4 Timer Counter 2 Timer Counter 4 External IRQ4 EEPROM 8 MHz from internal RC oscillator Radio Asynchronous timer interface Asynchronous timer System timer Wake up on DTR Storage for user settings accessible via Persistent Data Server 8200H AVR 02 10 AMEL 35 A
49. port PC1 Interface for amplifier if present ATmega ports PG3 PG4 Asynchronous timer interface Timer Counter 2 Asynchronous timer Timer Counter 4 System timer External IRQ4 Wake up on DTR External IRQ5 Radio interface Storage for user settings accessible via Persistent Data EEPROM Server ANMEL 29 SSE SO 8200H AVR 02 10 AMEL 10 Appendix A 4 ATmega128RFA1 Specifics 10 1 Getting Started 10 1 1 Required Hardware 10 1 2 Hardware Setup 30 AVR2052 BitCloud supports two different development platforms with ATmega128RFA1 a package development kit 14 and STK600 boards 15 If in the text below difference for these platforms is not stated explicitly then it is valid for both of them Before installing and using the BitCloud SDK for ATmega128RFA1 make sure that all necessary hardware is available 1 For a package e Two or more RCB128RFA1 boards with 2 4GHz antennas and AAA batteries e one or more RCB Breakout Boards e one RS232 interface cable for RCB Breakout Board e JTAGICE mkll 2 For STK600 boards o Two or more STK600 boards each with Atmega128RFA1 top card and 2 4GHz antenna o JTAGICE mkll For a package please refer to 14 for hardware setup instructions STK600 ATmega128RFA1 top cards require following modifications 1 Cover three bottom left contacts on the rear side of the top card with non conducting material e g paper sticker as shown by red rectangular on Figure 10 1
50. s Table 7 1 Typical problems and solutions Problem Solution For ATAVRRZRAVEN Make sure that WSNDemo image is loaded The LCD The AVRRAVEN board controlling logic depends on the application and may work does not indicate its differently for the images built by you activity on LCD WSN Monitor fails to start Make sure Java machine is properly installed on your PC See Section 4 No node is shown on the Check if the WSN Monitor uses the proper COM port and if Topology Pane in the WSN not change it and restart the program Monitor WSN Monitor shows NO No node is selected Select the required node by mouse DATA in the Sensor Data clicking on it Graph Pane Node titles displayed on the The displayed titles do not necessarily relate to the node Topology Pane do not show functions but they can be redefined by the user at any time node destinations These names are stored in the node title file see Section 5 5 along with MAC addresses mapped to the nodes 8200H AVR 02 10 8 Appendix A 1 ATAVRRZRAVEN Specifics 8 1 Getting Started 8 1 1 Required Hardware 8 1 2 Hardware Setup 8 1 3 System Requirements 8200H AVR 02 10 AVR2052 Before installing and using the BitCloud SDK make sure that all necessary hardware is available for the kit you would like to use 1 POON JTAGICE mkll One ATAVRRZUSBSTICK One or more ATAVRRAVEN boards 100 mil to 50 mil JTAG adapter 1
51. s described in Section 5 5 AMEL s ATMEL In the WSNDemo the number of routers and end devices is limited only by the network parameter settings described in Section 6 2 1 However for ATAVRRZRAVEN kit additional restrictions apply These are outlined in Table 5 1 Table 5 1 Allowed board role device type combinations for WSNDemo on ATAVRRZRAVEN Device Type Allowed Board Role Comments Coordinator needs USB interface to send Coordinator RZUSBSTICK data to PC side WSNMonitor application Router AVRRAVEN or RZUSBSTICK End nodes also demonstrate sleep End Node AVRRAVEN capabilities MCU and RF only 5 2 Programming the Boards 5 3 Running WSNDemo 6 AVR2052 As a first step WSNDemo images should be loaded onto the boards The locations of WSNDemo image files are platform specific and are provided in sections specified in Table 4 1 The programming instructions and the sets of pre built application images provided with the SDK also depend on the target platform The table below provides references to the sections that describe how to program each target platform and evaluation kit Table 5 2 Platform Specific Programming Sections For Platform Refer to Section ATAVRRZRAVEN 8 2 ZigBit ZigBit Amp ZigBit 900 9 2 megaRF 10 2 UC3 11 2 Running any ZigBee or ZigBee PRO application WSNDemo included requires that every device in the network has a 64 bit unique MAC address See the appropri
52. sh size 4096 words start address F000 BOOTRST Disabled CKDIV8 Disabled CKOUT Disabled SUT_CKSEL Ext Crystal Osc 3 0 8 0 MHz Start up time 16K CK 65 ms EXTENDED OxFC AMEL 17 18 AVR2052 ATMEL Option Value HIGH 0x99 LOW OxFD Table 8 4 Fuse bits setting for ATmega1284p AVRRAVEN Option Value BODLEVEL Brown out detection at VCC 1 8V OCDEN Disabled JTAGEN Enabled SPIEN Enabled WDTON Disabled EESAVE Disabled BOOTSZ Boot Flash size 512 words start address FE00 BOOTRST Disabled CKDIV8 Enabled CKOUT Disabled SUT_CKSEL Int RC Osc Start up time 6 CK 65 ms EXTENDED OxFE HIGH 0x9F LOW 0x62 Table 8 5 Fuse bits setting for ATmega3290p LCD on AVRRAVEN Option Value BODLEVEL Brown out detection at VCC 1 8V RSTDISBL Disabled OCDEN Disabled JTAGEN Enabled SPIEN Enabled WDTON Disabled EESAVE Disabled BOOTSZ Boot Flash size 512 words start address 3E00 BOOTRST Disabled CKDIV8 Enabled CKOUT Disabled SUT_CKSEL Int RC Osc Start up time 6 CK 65 ms EXTENDED OxFD HIGH 0x9D LOW 0x62 Firmware For additional details please refer to readme html gt RZRAVEN RZRAVEN Documentation gt Miscellaneous information gt the RZRAVEN Firmware with Programmer Debugger Programming section of 6 8200H AVR 02 10
53. shown in the figure below It contains topology pane sensor data pane node data pane and application toolbars AMEL r AMEL Figure 5 1 WSN Monitor GUI Topology pane displays the network topology in real time which helps the user monitor the formation and dynamic changes in the network while the nodes join T e o a Preferences Window Log packets Select node parar Quick Settings Toolbar 3000 Specific parameters for selected node sensor Data pane Ox4F32 Orphaned Nodes Nodes ist z List of omphaned nodes Nodes 19 Orphaned 1 Connected 18 send data or leave The network topology is constructed on the basis of next hop information for each of the nodes and each link is also tipped with RSSI and LQI values Each of the nodes displayed is depicted by an icon with the node s address or name below and sensor readings to the right of the icon if required by settings Router node 8 b gt Sensor data pane displays data coming from onboard sensors of the selected node see Section 5 5 2 It is presented in graph and table form Other parameters can be observed for each node in table form Node data pane includes a sensor selection combo box used to switch between sensor types By default in topology pane nodes are labeled with their short addresses However by a double click another title can be assigned to any desired node If Cancel is pressed in opened window s
54. splays the readings from onboard sensors next to a node icon inside Topology Pane see Section 5 5 For this corresponding option shall be selected in the node link parameters from the Quick Settings Toolbar The user can select any node in Topology Pane to monitor the node s activity and see the node data in three different forms e Text table e Chart e The onboard sensor s data displayed next to each node in topology pane These values are also tipped with arrows indicating whether the value increased or decreased in relation to the previous sample Note A given node is selected when clicked on and a dashed frame is drawn around it The same values are shown on Sensor Data Pane so the user can observe how the values change over a period of time Sensor Data Pane includes a Sensor Selection combo box Use the button on the Sensor Control Toolbar to display the desired types of sensor data AMEL AMEL 6 Programming with BitCloud API 6 1 API Overview 6 2 Development Tools AVR2052 The BitCloud internal architecture follows IEEE 802 15 4 and ZigBee defined convention for splitting the networking stack into its logical layers Besides the core stack containing the protocol implementation BitCloud contains additional layers implementing shared services e g task manager configuration manager and power manager and hardware abstractions e g hardware abstraction layer HAL and board support package BSP The A
55. ter CPU RAM Value 1GHz 512MB Free space on hard disk 200MB Intel Pentium III or higher Note 8200H AVR 02 10 AMEL 31 ATMEL Parameter JTAG emulator Operating system IDE Java Virtual Machine Value JTAGICE mkll emulator with cable Windows 2000 XP AVR Studio 4 17 and WinAVR 20090313 OR IAR Embedded Workbench AVR 5 3 with IAR C C Compiler for AVR 5 30 6 Java Runtime Environment JRE 5 Update 8 or later Note Required to upload and debug firmware onto the boards through JTAG see Section 5 2 Required to upload firmware images through JTAG see Section 5 2 and to develop applications using API see Section 6 2 Required to run WSNMonitor application 10 1 4 Installing the SDK AVR2052 Notes 1 Users are strongly recommended to use the specified version of WinAVR Other versions are not supported and may not work Proceed with the following installation instructions 1 Download the archive to your PC and unpack it into an empty folder with no blank spaces present in the directory path As a result the following SDK folders and files will be created Table 10 2 The SDK file structure Directory File Description Documentation Documentation on BitCloud software Bootloader Contains serial bootloader image file and installer for PC Evaluation Tools WSNDemo Embedded Ready to us
56. tor installer Monitor WSNMonitorSetup exe Evaluation Tools SerialNet Ready to use image files for SerialNet application Refer to 10 for more information on SerialNet BitCloud Components Header files for BitCloud Stack BitCloud Components BSP Source header and library files for BitCloud BSP BitCloud lib Library files for BitCloud Stack Sample Applications Source files for sample applications 2 Install desired IDE 2 1 For AVR Studio and WinAVR 2 1 1 Install AVR Studio 3 if not already installed on your PC 2 1 2 Install WinAVR development suite 4 if not already installed on your PC Be sure to install only the supported version of WinAVR as specified in Table 8 1 2 2 For IAR Embedded Workbench AVR AMEL 2 8200H AVR 02 10 AVR2052 AMEL eS 2 2 1 Install IAR Embedded Workbench for AVR 13 if not already installed on your PC 2 2 2 In SDK directory BitCloud lib make sure that in file Makerules ZigBit Atmegal281 8Mhz Iar and the IAR_PATH parameter points to the correct installation directory of IAR Embedded Workbench Modify it if needed 2 2 3 Add IAR Embedded Workbench bin directory for default installation located in C Program Files IAR Systems Embedded Workbench 5 3 avr bin to the system PATH environment variable To update the PATH variable go to Control Panel gt System gt Advanced gt Environment Variables s
57. w atmel com literature Disclaimer The information in this document is provided in connection with Atmel products No license express or implied by estoppel or otherwise to any intellectual property right is granted by this document or in connection with the sale of Atmel products EXCEPT AS SET FORTH IN ATMEL S TERMS AND CONDITIONS OF SALE LOCATED ON ATMEL S WEB SITE ATMEL ASSUMES NO LIABILITY WHATSOEVER AND DISCLAIMS ANY EXPRESS IMPLIED OR STATUTORY WARRANTY RELATING TO ITS PRODUCTS INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTY OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE OR NON INFRINGEMENT IN NO EVENT SHALL ATMEL BE LIABLE FOR ANY DIRECT INDIRECT CONSEQUENTIAL PUNITIVE SPECIAL OR INCIDENTAL DAMAGES INCLUDING WITHOUT LIMITATION DAMAGES FOR LOSS OF PROFITS BUSINESS INTERRUPTION OR LOSS OF INFORMATION ARISING OUT OF THE USE OR INABILITY TO USE THIS DOCUMENT EVEN IF ATMEL HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES Atmel makes no representations or warranties with respect to the accuracy or completeness of the contents of this document and reserves the right to make changes to specifications and product descriptions at any time without notice Atmel does not make any commitment to update the information contained herein Unless specifically provided otherwise Atmel products are not suitable for and shall not be used in automotive applications Atmel s products are not intended authorized or warranted for use as
Download Pdf Manuals
Related Search
Related Contents
T'nB TCUNSLIM6 remote control イアトロファインALBⅡ a part lui tout va bien je mange… moi non plus! 取扱説明書 User Manual - Teletronics International, Inc Maisons des Adolescents - Maison des Adolescents 27 Empire Products DV-35T-1 User's Manual TTP-245C / TTP-343C / TTP-244CE USER`S MANUAL Micca M703 User`s Manual Copyright © All rights reserved.
Failed to retrieve file