Atmel AVR2052 Quick Start Manual

Atmel AVR2052 Quick Start Manual

8-bit microcontrollers
Table of Contents

Advertisement

Quick Links

Atmel AVR2052: Atmel BitCloud Quick Start

Features

®
• Introduces Atmel
BitCloud
• Introduces WSNDemo application

1 Introduction

This document is intended for engineers and software developers evaluating the
®
Atmel BitCloud ZigBee
The 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 low-power, Atmel ZigBee-compliant wireless sensor network. The SDK
provides a complete software and documentation toolkit for prototyping,
developing, and debugging custom applications on top of the BitCloud application
programming interface (API), as well as easily demonstrating ZigBee technology in
action.
This document describes how to start quickly with the BitCloud SDK by installing
development environment and programming devices with sample applications. It
also provides a short introduction to the BitCloud API. To find more detailed
information concerning application development, refer to [2].
Guide
®
Software Development Kit (SDK)
PRO stack.
8-bit Atmel
Microcontrollers
Application Note
Rev. 8200M-AVR-11/11

Advertisement

Table of Contents
loading

Summary of Contents for Atmel AVR2052

  • Page 1: Features

    PRO stack. The 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 low-power, Atmel ZigBee-compliant wireless sensor network. The SDK provides a complete software and documentation toolkit for prototyping,...
  • Page 2: Overview

    The BitCloud stack is fully compliant with the Atmel 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 developers’...
  • Page 3 AT91SAM7X256 + AT86RF230 AT91SAM7X256 + AT86RF212 Please note that this document describes the use of the Atmel BitCloud SDK with the specific modules and evaluation kits listed in Table 2-1. Operation of BitCloud on supported MCU/RF combinations realized in a custom hardware application is outside the scope of this document.
  • Page 4: Getting Started

    3 Getting started This document describes how to quickly get Atmel BitCloud running. A typical starting scenario consists of the following: • Setting up the development environment. Note that platform-specific details are moved to the corresponding appendix chapters, as described in Table 3-1 •...
  • Page 5: Wsndemo Application

    The user interface is described in Section 4.5. The application is delivered with source code that demonstrates how to develop a wireless network application using the Atmel BitCloud API, and provides a number of useful programming templates for common application tasks. Development of custom applications is described in Section 4.5.
  • Page 6: Programming The Boards

    SDK that can be used right away without any modification. Atmel ZigBit platform does not require manual assignment of MAC addresses, as the evaluation boards are equipped with a dedicated unique ID chip or EEPROM, which the BitCloud stack uses automatically on startup.
  • Page 7: Network Startup

    Atmel AVR2052 4.4 Network startup The coordinator organizes the wireless network automatically. Upon starting, every node informs the network of its role. When the coordinator is powered on, 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 that child nodes can join the network with the coordinator’s extended PAN ID.
  • Page 8: Node Timeouts

    A node timeout corresponds to the time the WSNMonitor application waits for a packet from a Atmel AVR2052 8200M-AVR-11/11...
  • Page 9: Sensor Data Visualization

    Atmel AVR2052 particular node before assuming that the node is no longer part of the network. Note that this value does not correspond to the frequency with which data are transmitted by each type of device. To get smooth topology visualization, setting timeouts to 20 seconds is recommended for coordinator and router, and 30 seconds is recommended for an end device.
  • Page 10 Such device is able to receive and process commands from a PC over the serial link. To control the Runner device, the Bootloader PC tool included into the Atmel Serial Bootloader package is used (see Chapter 6). Pre-built images of the Runner application for various configurations are provided with the SDK and are located in the directory.
  • Page 11 Atmel AVR2052 Figure 4-3. Bootloader PC tool’s main screen. Figure 4-4. Bootloader PC tool’s devices screen. For complete description of OTAU implementation and usage in BitCloud, refer to [35]. 8200M-AVR-11/11...
  • Page 12: Developing Custom Applications With The Atmel Bitcloud Api

    5 Developing custom applications with the Atmel BitCloud API 5.1 API overview ® The BitCloud internal architecture follows IEEE 802.15.4 and the ZigBee-defined convention for splitting the networking stack into layers. Besides the core stack containing the protocol implementation, the BitCloud stack contains additional layers...
  • Page 13: Development Tools

    (BSP) includes a complete set of drivers for managing standard peripherals (for example, sensors, UID chip, sliders, and buttons) placed on development boards, such as those provided with Atmel ZigBit, Atmel ZigBit Amp, and Atmel ZigBit 900 evaluation kits. Please refer to for a more detailed description of the Atmel BitCloud API and its features.
  • Page 14: Reference Applications

    3-1. 5.2.1 Reference applications All Atmel BitCloud SDKs are supplied with the WSNDemo reference application provided in source code. WSNDemo is presented in detail in Chapter 4. To better understand the application payload format between network nodes and between the...
  • Page 15: Supported Toolchains

    5.2.2.1 Atmel AVR Studio 4 + WinAVR • Command line: Compile the application by running the make utility. • IDE: Open the .aps file from the appropriate directory with Atmel AVR Studio 4, and execute from the main menu.
  • Page 16: Reserved Hardware Resources

    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 the hardware abstraction layer (HAL) of the Atmel BitCloud stack. When building custom applications on top of the BitCloud API, the user is strongly encouraged to use the high-level APIs instead of the low-level register interfaces to ensure that its resource use does not overlap with that of the stack.
  • Page 17: Serial Bootloader And Otau

    The package can be downloaded from the Atmel website. It includes pre-built firmware images of the embedded bootloader, which shall be loaded to the device’s flash via JTAG, the source code of the embedded bootloader application, and the installation file for the Bootloader PC tool.
  • Page 18 These names are stored in the node title file (see Section 4.5) along with MAC addresses mapped to the nodes Atmel AVR2052 8200M-AVR-11/11...
  • Page 19: Appendix A-2: Zigbit Specifics

    8 Appendix A-2: ZigBit specifics 8.1 Getting started 8.1.1 Required hardware Before installing and using the Atmel BitCloud SDK, make sure that all necessary hardware is available: • Two or more Atmel ZigBit modules, operating in the same frequency band, mounted on PCBs with a UART RS-232 controller for serial communication •...
  • Page 20: System Requirements

    If you wish to demonstrate over-the-air upgrade functionality, an external flash memory device supported by the Atmel BitCloud SDK and OTAU embedded bootloader (for example, AT25F2048 or AT45DB041) must be attached to the Atmel ZigBit board, as shown in Table 8-4.
  • Page 21: Installing The Sdk

    Source files for the sample applications 2. Install the desired IDE: a. For IAR Embedded Workbench AVR: a. Install IAR Embedded Workbench for Atmel AVR [13], if not already installed on your PC. Add a Windows environment variable named IAR_AVR_HOME, and set its value to the IAR Embedded...
  • Page 22 Make sure that the driver is installed successfully and the new COM port is present in the device list. Check that the device is correctly shown in the Device Manager window, as in Figure 8-1. Figure 8-1. Correctly installed COM port for MeshBean device. Atmel AVR2052 8200M-AVR-11/11...
  • Page 23: Programming The Boards

    Atmel website. 8.2 Programming the boards A firmware image file can be uploaded into Atmel ZigBit devices in one of the following ways: using the Serial Bootloader package, using the JTAG interface, or using the ISP programmer interface.
  • Page 24: Extended (Mac) Address Assignment

    8.2.2 Extended (MAC) address assignment For proper operation, all nodes in a ZigBee network shall have unique, 64-bit MAC address values. At startup, the Atmel BitCloud software assigns the MAC address to a Atmel ZigBit device as follows. If at compile time the...
  • Page 25: Programming With Jtag

    (ISP) interface. For Atmel ZigBit devices, the ISP frequency shall be set to 6.478kHz, and the ISP programmer shall be connected to the module as specified in Table 8-9.
  • Page 26: Running Wsndemo

    WSNDemo application images are configured to use Extended PAN ID 0xAAAAAAAAAAAAAAAA and channel mask with: • Channel 0x0F enabled for ZigBit and Atmel ZigBit Amp (WSNDemoApp.hex), • Channel 0x00 and channel page 0 (WSNDemoApp_EU.hex) or channel 0x01 and channel page 0 (WSNDemoApp_RF212US.hex) for Atmel ZigBit 900,...
  • Page 27: Over-The-Air Upgrade Configuration

    • A dedicated device running the Runner application and performing the function of an over-the-air upgrade client • One of the supported external Atmel DataFlash devices is connected to the ZigBit module, as described in Section 8.1.2, and used to store uploaded application...
  • Page 28: Appendix A-3: Atmega128Rfa1 Specifics

    9 Appendix A-3: ATmega128RFA1 specifics 9.1 Getting started The Atmel BitCloud SDK supports two different development platforms with Atmel ATmega128RFA1: ATRF4CE-EK [14] and Atmel ATAVR128RFA1-EK1 [15] with Atmel ATSTK600 boards [16]. The instructions below highlight the differences between the two platform configurations, where present.
  • Page 29: System Requirements

    Atmel ATSTK600 [16]. Refer to AVR Studio Help for details on that subject. At the very least, make sure that the Atmel STK600 firmware is up to date, and configure the voltage provided by the STK600 for the Atmel ATmega128RFA1 top card.
  • Page 30: Installing The Sdk

    Source files for the sample applications 2. Install desired IDE: c. For IAR Embedded Workbench AVR: d. Install IAR Embedded Workbench for Atmel AVR [13], if not already installed on your PC. Add a Windows environment variable named IAR_AVR_HOME, and set its value to the IAR Embedded...
  • Page 31: Programming The Boards

    Bootloader require the Serial Bootloader package, which should be downloaded from the Atmel website. 9.2 Programming the boards A firmware image file can be uploaded into the Atmel ATmega128RFA1 device in one of the following ways: using the Serial Bootloader package or using the JTAG interface.
  • Page 32: Extended (Mac) Address Assignment

    0xFF, 0x9A, 0x62 9.2.2 Extended (MAC) address assignment For proper operation, all nodes in a ZigBee network shall have unique, 64-bit MAC address values. At startup, the Atmel BitCloud software assigns the MAC address to the ATmega128RFA1 device as follows: Atmel AVR2052...
  • Page 33: Programming With Serial Bootloader

    JTAG. Firmware images for the embedded bootloader as well as the Bootloader PC tool, which is needed to load the application image from a PC to the device, are included in the Atmel Serial Bootloader software package available for downloading from the Atmel website.
  • Page 34: Programming With Jtag

    .hex files are loaded with the serial bootloader. For example, to use JTAG to .srec program a device with the Atmel ATmega128RFA1 MCU on the Atmel STK600 board acting as coordinator, use the file with the name WSNDemo_Stk600_Atmega128rfa1_Coord.hex 9.4 Running WSNDemo 9.4.1 Starting WSNDemo...
  • Page 35: Demonstrating Ota Upgrade Functionality

    9.4.3 Demonstrating OTA upgrade functionality OTA upgrade functionality of the BitCloud SDK can be demonstrated using the megaRF platform by using the serial Atmel DataFlash device found on the STK600 board. Once the DataFlash device is connected to the Atmel ATmega128RFA1, as defined in Section 9.1.2,...
  • Page 36: Appendix A-4: Uc3 Specifics

    10 Appendix A-4: UC3 specifics 10.1 Getting started 10.1.1 Required hardware Before installing and using the Atmel BitCloud SDK for the Atmel 32-bit AVR UC3, make sure that all necessary hardware is available: 1. Two or more Atmel EVK1105 boards [18] 2.
  • Page 37: Installing The Sdk

    Library files for the BitCloud stack <SDK-Root>\Applications\ Source files for the sample applications 2. Install IAR Embedded Workbench for Atmel AVR32 [21], if not already installed on your PC. Be sure to install only the supported version of IAR Embedded Workbench, as specified in Table 10-2.
  • Page 38: Programming The Boards

    4. Download and install Java Runtime Environment [12], if not already installed on your PC. 5. Install the USB VCP driver on the Atmel EVK1105 to allow it to communicate with your PC. a. Connect JTAG to the UC3B JTAG header, and power on the board.
  • Page 39: Programming With Jtag

    Debug > Stop Debugging. 7. Unplug the JTAG from the UC3A JTAG header. 8. Reset the Atmel EVK1105. Alternatively, it is possible to load a ready-to-use image file in .elf format using Atmel AVR32 GNU Toolchain [20] by running following command in the console:...
  • Page 40: Running Wsndemo

    + sending data to UART Blinking (coordinator only) Sleeping (end device only) 10.5 Reserved hardware resources Table 10-6. Hardware resources used by the stack on an Atmel AT32UC3A0512. Resource Description Processor main clock 48MHz from external quartz 32-bit AVR ports A9, A20, A11, A12, A13...
  • Page 41: Appendix A-5: Atxmega Specifics

    11.1.1 Required hardware Before installing and using the Atmel BitCloud SDK, make sure that all necessary hardware is available for the kit you would like to use: • For Atmel STK600: Two or more Atmel ATSTK600s.
  • Page 42: System Requirements

    (AT45DB041) shall be connected to the Atmel ATxmega256A3/Atmel ATxmega256D3 pins specified in Table 11-1. The Atmel STK600 board already has built-in DataFlash, and so to use OTAU on an STK600, it is sufficient to connect the , and pins under the DataFlash...
  • Page 43: Installing The Sdk

    Source files for the sample applications 2. Install the selected IDE. e. For IAR Embedded Workbench AVR: d. Install IAR Embedded Workbench for Atmel AVR [13], if not already installed on your PC. Add a Windows environment variable named IAR_AVR_HOME, and set its value to the IAR Embedded...
  • Page 44: Programming The Boards

    Serial Bootloader package or using the JTAG interface. 11.2.1 Setting fuse bits Table 11-4 provides the default fuse bit configuration loaded into Atmel ATxmega256A3/Atmel ATxmega256D3 devices during production. It also describes some use cases when certain fuse bits require values different from the default ones.
  • Page 45: Extended (Mac) Address Assignment

    JTAG. Firmware images for the embedded bootloader as well as the Bootloader PC tool, which is needed to load the application image from a PC to the device, are included in the Atmel Serial Bootloader software package available for downloading from the Atmel website.
  • Page 46: Programming With Jtag

    Table 11-4) before uploading the image through JTAG. Don’t forget to select the correct device (the Atmel ATxmega256A3 or ATxmega256D3) in the Device and Signature Bytes field on the Main tab of the programming dialogue. After programming the image, reset the board.
  • Page 47: Pre-Built Images

    3. Program one device with the coordinator image file and other with either the router or end device images, as described in, as described in Section 11.2. 4. Attach the Atmel STK600 #1 (coordinator) RS-232 connector to a PC COM port. 5. Run WSNMonitor (see Section 4.5).
  • Page 48: Demonstrating Ota Upgrade Functionality

    11.4.3 Demonstrating OTA upgrade functionality OTA upgrade functionality of the BitCloud SDK can be demonstrated using the Atmel XMEGA platform by using the serial Atmel DataFlash device found on the STK600 board. Once the DataFlash device is connected to the Atmel ATxmega256A3, as defined in Section 11.1.2, the user should configure and install devices as follows:...
  • Page 49: Appendix A-6: At91Sam7X-Ek Specifics

    12.1 Getting started 12.1.1 Required hardware Before installing and using the Atmel BitCloud SDK, make sure that all necessary hardware is available for the kit you would like to use: • Two or more Atmel AT91SAM7X-EK kits. For each, additionally: Atmel RZ600 radio board with 10-pin squid cable •...
  • Page 50: Installing The Sdk

    1. Download the archive to your PC and unpack it into an empty folder. The following SDK folders and files will be created. Table 12-3. The SDK file structure. Directory/file Description <SDK-Root>\Documentation Documentation for the Atmel BitCloud software <SDK-Root>\Evaluation Ready-to-use image files for evaluating Tools\WSNDemo (Embedded) WSNDemo. Refer to Section 12.3...
  • Page 51: Programming The Boards

    For details about SAM-BA configuration and usage, please refer to SAM-BA User Guide [27]. NOTE The Atmel BitCloud stack and applications can be configured to store stack and application parameters in nonvolatile memory (typically, EEPROM). This functionality cannot be demonstrated with the stock SAM7X-EK kit, as there is no external EEPROM on these boards.
  • Page 52: Pre-Built Images

    Possible options are , and . For example, to use JTAG to program an China Atmel AT91SAM7X-EK device with an RF212 radio acting as coordinator for use in the US, use the file with the name WSNDemo_Coord_Rf212_US.bin NOTE Default images are preconfigured to use Extended PAN ID...
  • Page 53: Reserved Hardware Resources

    Atmel AVR2052 12.5 Reserved hardware resources Table 12-5. Hardware resources reserved by the stack on AT91SAM7X256. Resource Description SPI0 Radio interface ARM ports PA8, PA9, PA14, PA16, PA17, PA18, PA30 Radio interface Timer2 Microsecond timer Timer0 System timer External IRQ0...
  • Page 54: Appendix A-7: Sam3S Specifics

    RF231USB-RD. The instructions below highlight the differences between the two platform configurations, where present. 13.1.1 Required hardware Before installing and using the Atmel BitCloud SDK, make sure that all necessary hardware is available for the kit you would like to use: • For SAM3S-EK:...
  • Page 55: Installing The Sdk

    1. Download the archive to your PC and unpack it into an empty folder. The following SDK folders and files will be created. Table 13-2. The SDK file structure. Directory/file Description <SDK-Root>\Documentation Documentation for the Atmel BitCloud software <SDK-Root>\Evaluation Ready-to-use image files for evaluating Tools\WSNDemo (Embedded) WSNDemo. Refer to Section 13.3...
  • Page 56: Programming The Boards

    4. Download and install Java Runtime Environment [12], if not already installed on your PC. 13.2 Programming the boards A firmware image file can be uploaded into the Atmel SAM3S-EK device using the JTAG interface and using the Serial Bootloader package tools. 13.2.1 Extended (MAC) address assignment For proper operation, all nodes in a ZigBee network shall have unique MAC address values.
  • Page 57: Pre-Built Images

    Atmel AVR2052 The images that shall be loaded to the MCU via JTAG may be found under in the directory in the package. \Embedded_Bootloader_images\ At91sam3s4c If the embedded bootloader is loaded, the following steps should be executed to upload the application image file to the board: 1.
  • Page 58: Running Wsndemo

    To run WSN Demo application, proceed as follows: 1. Set up the hardware, as described in Section 13.1.2. 2. Install the Atmel BitCloud SDK, as described in Section 13.1.4. 3. Program one device with the coordinator image file and other with either the router or end device images, as described in Section 13.2.
  • Page 59: Appendix B-1: Wsndemo Over-The-Air Protocol

    Atmel AVR2052 14 Appendix B-1: WSNDemo over-the-air protocol 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 (for example,...
  • Page 60 4 bytes Unsigned int Battery status reading 4 bytes Unsigned int Temperature sensor reading 4 bytes Unsigned int Light sensor reading Table 14-5. Field data for type 0x20: Node name. Offset Length Description <Variable> Zero-terminated ASCII string Atmel AVR2052 8200M-AVR-11/11...
  • Page 61: Appendix B-2: Wsnmonitor Serial Protocol

    Atmel AVR2052 15 Appendix B-2: WSNMonitor serial protocol This appendix describes the protocol and message format used over the serial connection between the network coordinator and the WSNMonitor application running on the PC. The messages sent on the serial connection are basically the messages wrapped as defined below: Table 15-1.
  • Page 62: References

    [18] ATEVK1105 description [19] 32-bit AVR UC3 Software Framework 1.5.0 [20] AVR32 GNU Toolchain [21] IAR Embedded Workbench for Atmel 32-bit AVR [22] IAR Embedded Workbench for Atmel ARM [23] Eclipse IDE for C/C++ Developers [24] YAGARTO compiler tool chain [25] AT91SAM7X-EK Evaluation Board for AT91SAM7X and AT91SAM7XC.
  • Page 63 Atmel AVR2052 [36] RF231USB – User Guide 8200M-AVR-11/11...
  • Page 64: Table Of Contents

    4.5.1 Node timeouts ......................8 4.5.2 Sensor data visualization ................... 9 4.5.3 Over-the-air upgrade ....................9 5 Developing custom applications with the Atmel BitCloud API .. 12 5.1 API overview ...................... 12 5.2 Development tools ..................... 13 5.2.1 Reference applications .................... 14 5.2.2 Supported toolchains ....................
  • Page 65 Atmel AVR2052 8.5 Reserved hardware resources ................27 9 Appendix A-3: ATmega128RFA1 specifics ........28 9.1 Getting started ....................28 9.1.1 Required hardware ....................28 9.1.2 Hardware setup ....................... 28 9.1.3 System requirements ....................29 9.1.4 Installing the SDK ....................30 9.2 Programming the boards ...................
  • Page 66 13.5 Reserved hardware resources ................ 58 14 Appendix B-1: WSNDemo over-the-air protocol ....... 59 14.1 Message format ....................59 14.2 Additional fields ....................59 15 Appendix B-2: WSNMonitor serial protocol ....... 61 16 References ..................62 17 Table of contents ................. 64 Atmel AVR2052 8200M-AVR-11/11...
  • Page 67 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 THE ATMEL...

Table of Contents