Atmel AVR2070 Datasheet

Browse online or download Datasheet for Networking Atmel AVR2070. Atmel AVR2070 Datasheet User Manual

  • Download
  • Add to my manuals
  • Print
  • Page
    / 93
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 0
AVR2070: Route Under MAC (RUM) with IPv6
and 6LoWPAN
Features
A FREE 802.15.4 networking solution
- Multi-hop Route Under MAC (RUM)
- All Atmel IEEE 802.15.4
TM
transceivers supported
- Many AVR
®
microcontrollers supported
Completely Customizable Firmware
- Ready to use as the basis for a wireless product
- Standalone MAC data layer for small memory footprint
- Optional IPv6/6LoWPAN Interface layer provides worldwide wireless
connectivity over the IPv6 internet
1 Introduction
Wireless Sensor Networks (WSN) have become a low power, low cost means for
communicating data between sensor devices dispersed over an area. Many of
these applications call for small embedded wireless networking solutions to
substantially reduce the cost of all required components. Atmel
®
’s Route Under
MAC (RUM) with support for IPv6 and 6LoWPAN is a highly flexible stack solution
for these low cost applications. Providing Internet Protocol (IP) over low power, low
data rate wireless transceivers enables immediate interoperability with existing
wired networks. With an IPv6 foundation, each wireless node on the network can
be given a worldwide unique IPv6 address and directly communicate with any other
IPv6 device in the world without the need for any translation or a complex gateway.
Free to Atmel customers, the Atmel RUM/6LoWPAN networking stack proves to be
a ready and cost-effective solution for Wireless Sensor Networks.
MCU Wireless
Solutions
Application Note
Rev. 8240B-AVR-06/09
Page view 0
1 2 3 4 5 6 ... 92 93

Summary of Contents

Page 1 - 1 Introduction

AVR2070: Route Under MAC (RUM) with IPv6 and 6LoWPAN Features • A FREE 802.15.4 networking solution - Multi-hop Route Under MAC (RUM) - All A

Page 2

10 AVR2070 8240B-AVR-06/09 3.3 Build Sizes This section shows various build sizes using different compile flags described from Table 3-1. Table 3-2

Page 3 - 2.1 Overview of RUM

AVR2070 118240B-AVR-06/09 4 AT91SAM7X-EK RUM Quickstart The Atmel RUM protocol is integrated to run on the AT91SAM7X-EK board which contains an AT91

Page 4

12 AVR2070 8240B-AVR-06/09 4.1.1 uTasker Patches Since uTasker is a licensed RTOS, only a binary image has been provided for demonstration purposes.

Page 5

AVR2070 138240B-AVR-06/09 This project should now include the original uTasker OS, SP4, and RUM patch files. A test compile can now be tried using t

Page 6

14 AVR2070 8240B-AVR-06/09 TRX Pin SAM7X MCU Pin Port Port Function SCK 50 PA22 SPI1_SPCK SEL 49 PA21 SPI1_NPCS0 IRQ 80 PA30 IRQ0 CLKM 70 PB24 TI

Page 7

AVR2070 158240B-AVR-06/09 the source code and precompiled code have USB disabled. Due to limitations on the SAM7X board, if a reset is necessary, th

Page 8

16 AVR2070 8240B-AVR-06/09 Note: The SAM-ICETM JTAG adapter does not work for Linux based systems running the Rowley Crossworks IDE. 4.6 Loading the

Page 9

AVR2070 178240B-AVR-06/09 Figure 4-6-2 SAM-BA File Selection Once the image has been selected in the “Send File Name” field, connect the SAM-ICE JT

Page 10 - AVR2070

18 AVR2070 8240B-AVR-06/09 Once the webpages are transferred, the default IP address of 192.168.1.125 must be entered into the selected internet brow

Page 11 - 4.1 uTasker RTOS

AVR2070 198240B-AVR-06/09 Figure 4-7-2 Simple Webserver Network Table 4.8 SD File Handling The maximum size of SD card is 2 GB. The card should be

Page 12

2 AVR2070 8240B-AVR-06/09 2 Stack Architecture Route Under Mac (RUM) is a small 802.15.4 protocol developed by Atmel. This protocol routes packets at

Page 13 - 4.2 Radio Interface

20 AVR2070 8240B-AVR-06/09 5 Running the RUM Demo Now that all the platforms have been properly configured with RUM, operating the RUM demo without I

Page 14

AVR2070 218240B-AVR-06/09 Table 5-1 ARM Telnet Menu Commands ASCII Command Description a (lowercase) IP Address. This is the current IPv4 address

Page 15 - 4.5 AT91SAM-ICE

22 AVR2070 8240B-AVR-06/09 Table 5-2 AVR Serial Menu Commands ASCII Command Description T Touch. Ping or send a Reading (asks for ‘p’ or ‘r’ &

Page 16

AVR2070 238240B-AVR-06/09 6 Running the IPv6 Demo This demo requires the AT91SAM7X-EK to be used as the PAN Coordinator, due to the Ethernet interfa

Page 17 - 4.7 Simple Web Interface

24 AVR2070 8240B-AVR-06/09 If an IP address for the Ethernet side is not seen, this means an IPv6 router was discovered on the network. However the r

Page 18

AVR2070 258240B-AVR-06/09 6.3 Using the 6LoWPAN / IPv6 Code on End Nodes The 6LoWPAN / IPv6 API is documented using the Doxygen documentation system

Page 19 - 4.8 SD File Handling

26 AVR2070 8240B-AVR-06/09 The IPSO demo has two parts to it. The first part is an interactive control to allow polling of the sensor and configurati

Page 20

AVR2070 278240B-AVR-06/09 A<enter> A0 A1<enter> A<enter> A1 HTL<enter> H50T22.5L50 A0A<enter> A0 This also demonstrat

Page 21 - 8240B-AVR-06/09

28 AVR2070 8240B-AVR-06/09 When setting an IP address, the full IP address must be specified with all zeros present. If the address is short any byte

Page 22

AVR2070 298240B-AVR-06/09 By passing the messages over an IPv6 link, it does not matter if the sensors communicate directly with the coordinator or

Page 23 - 6 Running the IPv6 Demo

AVR2070 38240B-AVR-06/09 2.1 Overview of RUM A RUM network is constructed around a coordinator. The coordinator is the only node that keeps any stat

Page 24

30 AVR2070 8240B-AVR-06/09 6.7 Sleeping Nodes A node that spends much its time asleep is good for battery life, but makes IP connectivity harder. If

Page 25 - 6.4 IPSO App Example

AVR2070 318240B-AVR-06/09 Appendix A - Route Under MAC (RUM) Protocol A.1 Overview This appendix outlines the scheme used by RUM for implementing a

Page 26

32 AVR2070 8240B-AVR-06/09 8. Some pre-deployment configuration can be used to determine whether a given node should or can join a given network. T

Page 27

AVR2070 338240B-AVR-06/09 Figure A-4-2 Direct Association Message Sequence End/Router Node Pan Coord NodeAssociation RequestAssociation Response The

Page 28

34 AVR2070 8240B-AVR-06/09 Figure A-4-3 In-Direct Association Message Sequence End/Router Node Pan Coord NodeAssociation Request DirectAssociation Re

Page 29 - 6.6 TFTP Bootloading

AVR2070 358240B-AVR-06/09 • If neither of the above conditions apply, then send the packet to the last routed address used for sending (which was s

Page 30

36 AVR2070 8240B-AVR-06/09 • The destination node must be more than two hops away from the coordinator. For one or two hops, there is no ambiguity

Page 31 - A.3 Assumptions

AVR2070 378240B-AVR-06/09 Figure A-5-1 Example Network Commissioning Diagram CR9 R8R1 R3R2 E3E1E2SA: 0x0000(always)SA: 0x0003SA: 0x0002SA: 0x0004SA:

Page 32

38 AVR2070 8240B-AVR-06/09 Table A-5-1. Beacon request and beacon frames E1 FCF – beacon req 0x0803 Seq 01 Broadcast PAN ID 0xffff Broadcast short a

Page 33

AVR2070 398240B-AVR-06/09 C sends association response. Table A-5-7. Associaton response (direct) C FCF – assoc rsp 0x8C63 Seq 03 PID 0x1234 E1 MAC

Page 34

4 AVR2070 8240B-AVR-06/09 2.3 Supported Hardware Platforms The RUM software distributed with this application note can run on a variety of platforms.

Page 35

40 AVR2070 8240B-AVR-06/09 Table A-5-11. Association response (direct) R1 FCF – assoc rsp 0x8C63 Seq 03 PID 0x1234 R2 MAC addr 0x5555444433332222 R1

Page 36

AVR2070 418240B-AVR-06/09 A.6 Routing packets There is a special packet used to create a route for a packet leaving the coordinator toward any route

Page 37

42 AVR2070 8240B-AVR-06/09 Table A-6-3. End node E2 to Coordinator C via Router R2 E2 FCF – Data 0x8861 Seq 34 PID 0x1234 R2 SA 0x0006 E2 SA 0x0007Fi

Page 38

AVR2070 438240B-AVR-06/09 Appendix B - Firmware API Overview This appendix discusses how the RUM firmware is implemented, what Application Programm

Page 39

44 AVR2070 8240B-AVR-06/09 If a frame was received by the radio, it is transferred from the transceiver into a receive buffer in the host processor.

Page 40

AVR2070 458240B-AVR-06/09 Figure B-2 appInit overview

Page 41 - A.6 Routing packets

46 AVR2070 8240B-AVR-06/09 Figure B-3 macTask overview

Page 42

AVR2070 478240B-AVR-06/09 Figure B-4 macDataIndication overview

Page 43 - B.1 Program Organization

48 AVR2070 8240B-AVR-06/09 RoutingStartAm I coordinator?CoordSend routing packet if necessaryResend packet to first router in chainIs dest a child of

Page 44

AVR2070 498240B-AVR-06/09 Figure B-6 Radio ISR overview

Page 45 - Figure B-2 appInit overview

AVR2070 58240B-AVR-06/09 2.3.3 Raven USB This is the USB stick that comes with the ATAVRRZRAVEN kit. This board has an AT90USB1287 microcontroller,

Page 46

50 AVR2070 8240B-AVR-06/09 The flowchart shown in Figure B-5 shows how the RUM protocol routes packets. Most of this processing occurs in the macRou

Page 47

AVR2070 518240B-AVR-06/09 For more detailed examples of association and sending sensor data, see MAC function calls and Sensor application function

Page 48

52 AVR2070 8240B-AVR-06/09 B.3 6LoWPAN API This group of functions is used to send a UDP packet to a node either on the wireless network (‘iplocal’)

Page 49

AVR2070 538240B-AVR-06/09 Figure B-7 AVR 6LoWPAN DataIndication

Page 50

54 AVR2070 8240B-AVR-06/09 Figure B-8 ARM 6LoWPAN DataIndication sixlowpan_DataIndication()StartEndCall 6LoWPAN Layer to uncompress packet to bufferC

Page 51

AVR2070 558240B-AVR-06/09 and the RF231 and RF212 radios can be configured for rising or falling edge via the IRQ_POLARITY register value. In additi

Page 52

56 AVR2070 8240B-AVR-06/09 #ifndef __AVR_ATmega1281__ #error "Incorrect MCU for Platform! Check Makefile" #endif // Set this to

Page 53

AVR2070 578240B-AVR-06/09 # define HAL_INIT_ADC() DIDR0 |= (1 << ADPIN), \ ADMUX = 0xC0 | ADPIN, ADCSRA = 0x84 # define HAL_STOP

Page 54

58 AVR2070 8240B-AVR-06/09 control) and press the enter key. A simple terminal menu should be printed, and the ASCII 'd' character should

Page 55 - #elif PLATFORM==MY_NEW_BOARD

AVR2070 598240B-AVR-06/09 Appendix C - IPv6 / 6LoWPAN Background Using IPv6 and 6LowPAN will be easier if an understanding of the underlying techno

Page 56

6 AVR2070 8240B-AVR-06/09 3 AVR RUM Quickstart In order to operate the RUM demo application, make sure one of the platforms described in this documen

Page 57

60 AVR2070 8240B-AVR-06/09 Any leading zeros can be dropped, writing addresses like: 2001:DB8:0:0:8:800:200C:417A Finally a number of zeros in the

Page 58

AVR2070 618240B-AVR-06/09 Figure C-4-1 IPv6 Router Discovery C.4.3 Node Auto-configuration On power-up a node uses these packets to acquire an addr

Page 59 - C.4 A Crash Course in IPv6

62 AVR2070 8240B-AVR-06/09 10. Node is now on the network. It can be seen how IPv6 simplifies auto-configuration of network addresses. Nodes no longe

Page 60

AVR2070 638240B-AVR-06/09 Traffic Class and Flow Label encoding A message will be properly parsed by end-nodes regardless if traffic class and flow

Page 61

64 AVR2070 8240B-AVR-06/09 Compared to normal IPv6 networks, there are some differences to how a node acquires its IPv6 address. A typical startup se

Page 62

AVR2070 658240B-AVR-06/09 Appendix D - AT91SAM7X-EK Development Tools uTasker can be compiled in a number of different environments: IARTM, Rowley

Page 63

66 AVR2070 8240B-AVR-06/09 Figure D-1-3 uTasker and RUM Integrated Folder Structure D.2 Rowley Crossworks IDE Rowley Crossworks is a cross platform

Page 64

AVR2070 678240B-AVR-06/09 5. Load J-Link .dll for debugging a. Target -> Connect Segger J-Link b. Should see “DLL WARNING” c. Select Tools -&

Page 65 - D.1 Folder Structure

68 AVR2070 8240B-AVR-06/09 folder structuring has been properly followed; the Rowley project file should build as expected. Figure D-2-2 Rowley IDE

Page 66

AVR2070 698240B-AVR-06/09 Figure D-2-3 Rowley Project Properties Then click on the ellipsis button to bring up the Preprocessor Definitions window

Page 67

AVR2070 78240B-AVR-06/09 Figure 3-1 AVR Studio RUM Project Options Figure 3-2 AVR Studio RUM Compile Flags

Page 68

70 AVR2070 8240B-AVR-06/09 Note: Sometimes the SAM7X will retain old FLASH values such as IP addresses. This can be a valuable feature during code re

Page 69

AVR2070 718240B-AVR-06/09 Figure D-3-1 Eclipse Workspace Selection In this example they are stored in the f:\eclipse_projects directory. With that

Page 70

72 AVR2070 8240B-AVR-06/09 Finally the RUM project can be imported. This is done by going to the “File -> Import” menu. Select the type as “Existi

Page 71

AVR2070 738240B-AVR-06/09 Point the root directory to the RUM source code. It should automatically find the project, and optionally one can check th

Page 72

74 AVR2070 8240B-AVR-06/09 Change the “compiler invocation command” to point to the YAGARTO installation. In this example it is located at C:\Progra

Page 73

AVR2070 758240B-AVR-06/09 Next open the “Settings” pane under “C/C++ Build”. Select the “GNU Elf Parser” checkbox, then point both the addr2line an

Page 74

76 AVR2070 8240B-AVR-06/09 Figure D-3-8 Eclipse Debug Plugin Press “Add Site” and add the site http://opensource.zylin.com/zylincdt and press OK. No

Page 75

AVR2070 778240B-AVR-06/09 D.3.5 Programming the FLASH First programming the FLASH memory with SAM-PROG will be covered. With the SAM-ICE connected,

Page 76

78 AVR2070 8240B-AVR-06/09 Figure D-3-11 Segger J-Link Connection Screen Next Eclipse needs to be set up to work with the GDB Server. To do this cli

Page 77

AVR2070 798240B-AVR-06/09 A new window will pop up, and select the “Zylin Embedded debug (Native)” category, and hit the new button. Set the name, a

Page 78

8 AVR2070 8240B-AVR-06/09 For command line operation using avr-gcc, options should be passed on the command line as define (-D) options, such as: avr

Page 79

80 AVR2070 8240B-AVR-06/09 monitor endian little # Set JTAG speed to 30 kHz monitor speed 30 # Reset the radio to get to a known state. monitor res

Page 80

AVR2070 818240B-AVR-06/09 this tutorial the external SAM-PROG tool is used instead. The flash breakpoints feature removes the limit of two hardware

Page 81

82 AVR2070 8240B-AVR-06/09 Figure D-3-16 Debugging Tools The “Variables” section contains all local variables for the current function. To add a glo

Page 82

AVR2070 838240B-AVR-06/09 Figure D-3-20 Debug Terminate/Disconnect Option Once debugging is finished, the process can begin again. After re-compili

Page 83

84 AVR2070 8240B-AVR-06/09 Appendix E - Third-Party Reference Designs / Platforms This section describes various reference designs that can be purch

Page 84

AVR2070 858240B-AVR-06/09 Figure E-1-1 AT91SAM7X-EK Standard Board Figure E-1-2 REB and REX_ARM adaptor Figure E-1-3 AT91SAM7X-EK with REB/REX_A

Page 85

86 AVR2070 8240B-AVR-06/09 E.2 RCB212 This platform is a version of RCB (Radio Control Board) from Atmel, designed specifically for the AT86RF212 rad

Page 86

AVR2070 878240B-AVR-06/09 E.5 DSK001 This platform is a small circular PCB containing an RF230 or RF231 radio transceiver, an ATmega48/88/168/328 fa

Page 87 - E.7 Fuses

88 AVR2070 8240B-AVR-06/09 Glossary 6LoWPAN - A scheme to compress and fragment IPv6 packets for transmission over an 802.15.4 wireless network. See

Page 88

AVR2070 898240B-AVR-06/09 Multi-hop - A network that can relay packets over several wireless nodes to a destination. RUM has multi-hop capability,

Page 89

AVR2070 98240B-AVR-06/09 Option Name Possible values Meaning IPV6LOWPAN 0 1 Compiles in 6LoWPAN functionality, which gives each node in the networ

Page 90

90 AVR2070 8240B-AVR-06/09 Table of Contents Features...

Page 91

AVR2070 918240B-AVR-06/09 6.4.1 Commands on Port 61616... 26 6.4

Page 92

92 AVR2070 8240B-AVR-06/09 C.5.1 Draft-ietf-6lowpan-hc01....... 6

Page 93 - Headquarters International

8240B-AVR-06/09 Disclaimer Headquarters International Atmel Corporation 2325 Orchard Parkway San Jose, CA 95131 USA Tel: 1(408) 441-0311 Fax: 1(

Comments to this Manuals

No comments