Atmel AVR2070 Installation and operating instructions

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.4TM 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

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 the MAC layer, as opposed to the application or IPv6 layer,
which would be a route over scheme. The under comes from the fact that routing is
done at a low level. This has a number of advantages:
•Routers and end nodes can be simpler, and therefore less expensive. These
nodes manage almost no routing information.
•The coordinator knows all pertinent information about every node in its PAN,
which means special “guessing” routing algorithms are not needed.
•Higher level code does not have to be concerned with routing, and has only
to send a packet to a destination address.
The main components of the stack include RUM, and IPv6 / 6LoWPAN. The complete
stack features the following highlights:
•Small object size. A minimal build, with only RUM and a tiny example
application, is about 6KB for an AVR end node.
•Self-forming network. Nodes power up, find a network, and associate to it.
•Self-healing network. Nodes re-associate upon a failure to communicate.
•Multi-hop routing. Nodes can be multiple hops away from the coordinator.
•Source Code Included.Free for use and free to modify if used with Atmel
hardware.
•Designed to be a base platform for customer applications.
•Very configurable, with the ability to add or remove features at compile time.
Features include 6LoWPAN frames, end node sleeping, and a terminal mode.
•Portable to almost any Atmel processor.
Figure 2-1 RUM Architecture

AVR2070
3
8240B-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 state information about the network, so that the other nodes do not
have to store any network information. This allows for low cost hardware for both
routers and end-nodes which comprise the bulk of the network. A router can act as a
multi-hop intermediary for other nodes, while an end node can attach to a network,
but cannot associate child nodes. Any node is usable as a data node or actuator.
The network is organized as a tree, with the coordinator having a number of
associated nodes as children, and router nodes having their own associated children
as well. Each node has exactly one parent, which is also the node's link to every
other part of the network.
Figure 2-2 RUM Tree Topology Example
Appendix A contains a detailed description of the RUM protocol.
2.2 Overview of IPv6 and 6LoWPAN
The features of IPv6 and 6LoWPAN allow the RUM coordinator to act as an edge
router in the worldwide network. The full functionality of these features are best
utilized on the AT91SAM7X-EK development kit which provides an Ethernet
connection. This application setup is described in section 4.
Any wireless node connected to the coordinator/edge router will obtain a unique IPv6
address based on its RUM short address. Depending on the application, the wireless
node can then report sensor data directly to the coordinator/edge router, some other
server or IPv6 addressable device via the IPv6 internet connection. This node can
also receive commands when necessary based on application software.
More details about the interaction between RUM/6LoWPAN can be found in Appendix
C.

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. The PLATFORM keyword defines several parameters about a board. An
example of these parameters is:
•Which microcontroller is present on the platform board?
•How the microcontroller is connected to the transceiver – which radio pins
connect to which port pins on the microcontroller.
•Any ADC connections to the microcontroller.
•Any LED and switch connections to the microcontroller.
•Which band the board uses – 2.4GHz, 928MHz, 868MHz or 783MHz.
See the documentation included with the source code for implementation details.
2.3.1 AT91SAM7X-EK
The Atmel AT91SAM7X-EK evaluation kit can be purchased from a local Atmel
distributor. This evaluation kit embeds an AT91SAM7X256 microcontroller which
contains an Ethernet peripheral. By obtaining any of the AT86RF2xx transceivers, the
platform can be assembled to operate as a RUM coordinator and/or IPv6 edge router.
This platform is further discussed in section 4.
2.3.2 Raven
The ATAVRRZRAVEN is the official development kit for the AT86RF230. The kit
contains two Raven boards (with LCD and joystick interface), and one Raven USB
stick.
The Raven platform has two microcontrollers – one for the radio and one for the
Raven user interface. The RUM software lives in the ATmega1284P microcontroller,
and the user interface software – supplied with RUM – lives in the ATmega3290P
microcontroller.
The user interface is not required – RUM can work as a coordinator, router, or end
node without a user interface on the Raven.
To debug RUM on Raven, two miniature 10-pin headers (supplied with RZRAVEN)
must be soldered to the board so that the programming tool can be plugged in. The
JTAGICE mkII and AVRISP programming tools can each program the Raven board.
The batteries on Raven are not sufficient to run continuously while debugging, so an
external 3V supply is recommended. Two AAA batteries make a suitable supply for
debugging if no bench supply is available.
The two processors communicate to each other using serial ports. There is an extra
serial port on the ATmega1284P microcontroller that is dedicated to the DEBUG
function. However, external wires must be added to access this port, and the signal
levels are at low logic levels, not the high voltage levels required to drive a computer's
serial port.
More information about the Raven board can be found in application note AVR2016.

AVR2070
5
8240B-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, which includes a built-in USB interface. Building for
the RAVENUSB platform includes the driver code for the CDC-USB interface.
The Raven USB board requires that a miniature 10-pin header (supplied with
RZRAVEN) must be soldered in for connection to the JTAG debugging port. The
JTAGICE MKII programmer will program the Raven USB board. There is not an ISP
programming header available on the USB stick.
The Raven USB stick can work as a coordinator, router, end node or sniffer with a
CDC-USB interface.
More information about the Raven USB board can be found in application notes
AVR2002 and AVR2016.
2.3.4 ZigBit / ZigBit900
These two platforms are small radio modules containing a radio (either AT86RF230
for the ZigBitTM, or an AT86RF212 for the ZigBit900) and an ATmega1281V
microcontroller.

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 document has been selected, or that a custom platform has been
properly defined in the hal_avr.h file. Also the use of an Atmel JTAGICE mkII or
AVRISP programmer will be required to program the target microcontroller.
After the target platforms and the programming tools required have been gathered,
setup the software necessary for development. For Windows®users, AVR Studio®
along with the free WinAVR tool chain can be used and downloaded free from
www.atmel.com and www.sourceforge.net. For Linux®users, the tools have to be
installed and run individually.
3.1 Source Code
The RUM source code that accompanies this Application Note is spread out over
several directories. The core RUM files are located in the \rum_src directory, and all
of the other directories support the uTasker operating system, which is only used with
the SAM7X version of RUM.
For AVR nodes, only the \rum_src directory is needed.
3.2 Compiling RUM
RUM has been written to work with the AVR version of the GCC compiler. AVR
Studio will compile and debug the RUM software. Alternatively for Linux, a RUM
application can be compiled and debugged using avr-gcc and other free tools.
Within the \rum_src directory, there are three AVR Studio project files that will compile
for the appropriate device of choice. There is also a Makefile that can be used with
command line tools as well. These projects have all been pre-configured with default
compile flags described in the table 3-1 below.
3.2.1 Compile-time Options
Rum is a very configurable protocol stack. Using a few compile-time flags, RUM can
be configured to run in a minimal amount of flash (less than 6K), or it can be
configured to that handle 6LoWPAN packets, serve data on a periodic basis, and
sleeps between readings. In AVR Studio, the compile-time flags described in table 3-
1 are entered into the Project Options dialog box. This process is shown in figures 3-1
and 3-2.
Note:
In order to compile a small flash image size for an End Node device,
the linker needs to be configured to remove any standard libraries like
printf and floating point libraries. AVR Studio linker options can be
found in the Custom Options tab of the Project options as shown in
figure 3-2. The [Linker Options] selection is located in the file list of the
left window pane. Linux users can adjust the Makefile to remove these
libraries from the command line.

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

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-gcc -mmcu=atmega1281 -DF_CPU=8000000UL -DPLATFORM=RAVEN -o radio.o
radio.c (etc.)
Here is a list of available compile-time flags:
Table 3-1 Compile Time Flags
Option Name Possible values Meaning
PLATFORM RAVEN
RAVENUSB
ZIGBIT9
ZIGBIT24
Build RUM to work with the given platform.
This option can set other options, such as the
band the radio operates in (700/800/900MHz
or 2.4GHz).
Note: Not required for the ARM version of
RUM. Set PLATFORM to 0.
COORDNODE Undefined or 1 Set this variable to cause the node to be a
coordinator node.
Note: The ARM version of RUM assumes
only a coordinator node.
ROUTERNODE Undefined or 1 Set this variable to cause the node to be a
router node.
ENDNODE Undefined or 1 Set this variable to cause the node to be an
end node.
APP 0 (No application)
SENSOR
IPSO
Compiles in (or leaves out) the sensor
application. New applications can be added
to the list.
DEBUG 0
1 When DEBUG is set to 1, debugging
messages can be sent out the debug port.
Also, a simple terminal interface is available
in debugging mode (Not all platforms support
this with hardware).
Note: The definition of SERIAL or
OTA_DEBUG must be used in order to use
the DEBUG flag.
DEMO 0
1 In demo mode, a node joining the network
chooses to associate to the node with the
best signal (RSSI). This allows
demonstrating multi-hop functionality in a
small area. In non-demo mode, a new node
chooses its parent based on (in order):
1. Best LQI (Link Quality Indication)
2. Lowest number of hops to coordinator
3. Best RSSI.
RUMSLEEP 0
1 Sleep mode enables the ENDNODE to sleep.
If the sensor app (APP=SENSOR) is also
compiled in, then the node will sleep between
consecutive sensor readings.
Note: Coordinators and routers do not sleep,
but the RUMSLEEP flag includes code to
wake up end nodes and put them to sleep.
WDOG_SLEEP 0
1 Setups the Watchdog timer to act as the
timing source for the sleeping operation.
Note: If set to 0, sleeping relies on an
external 32.768KHz crystal.

AVR2070
9
8240B-AVR-06/09
Option Name Possible values Meaning
IPV6LOWPAN 0
1 Compiles in 6LoWPAN functionality, which
gives each node in the network a world-
unique IPV6 address, and formats packets
according to RFC4944. Without this option,
smaller RUM-only frames are used.
SENSOR_TYPE 0 (None)
SENSOR_RANDOM_T
SENSOR_RANDOM_H
SENSOR_THERMIST
Configures the sensor application
(APP=SENSOR) to collect data from the
given sensor type.
SENSOR_RANDOM_T/_H uses a random
number generator to create variable
temp/humidity data.
SENSOR_THERMIST reads a simple
thermistor from the AVR's ADC.
Note: Not all platforms support this with
hardware. SENSOR_TYPE does not apply to
the ARM version of RUM.
PAN_CHANNEL 1-4 (700MHz)
0-10 (800/900Mhz)
11-26 (2.4GHz)
Sets the operating channel to a static channel
if specified. Leaving PAN_CHANNEL
undefined will cause a coordinator node to
scan all channels to select a quiet free
channel, and will cause router/end nodes to
scan all channels to find a network to join.
Note: If CHINA_MODE=1, then 700MHz
channels are enabled.
PAN_ID 0x0000 - 0xFFFF Sets a static PAN_ID for the specified
network. Otherwise a random PAN_ID will be
selected.
Note: A static PAN_ID is required for the IPv6
addresses in the demo. See Appendix C.
BAND BAND2400
BAND900 The BAND flag specifies which radio band to
use. For AVR targets, this parameter is fixed
for each PLATFORM to its correct value, and
should not be directly passed to the compiler
as a parameter. For the ARM target, this
parameter can be passed as a compile-time
option, or directly set in hal_arm.h.
CHINA_MODE 0
1 Sets the use of 700MHz operation for the
China band.
Note: This mode is only available when using
the AT86RF212 (BAND=BAND900).
DATA_RATE_212 BPSK-40 Can be changed to any of the supported
operating modes of the RF212.
Note: If using CHINA_MODE, the selected
data rate is O-QPSK RC 250.
CAL 0
1 Enables the calibration feature with the
SENSOR application.
VLP 0
1 This will allow a Very Low Power device to
sleep between frame protocol operations
(scan, associate, etc) to save power.
SERIAL 0
1 Used with DEBUG to send debug messages
to a serial port.
OTA_DEBUG 0
1 Used with DEBUG to send debug messages
over the air to the coordinator for processing.

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 Various Build Sizes for AVR and ARM
Coordinator Router End Node
Raven USB Coordinator
IPv6 off
DEBUG on
Sensor App
SLEEP on
25332 bytes FLASH
4811 bytes SRAM
Raven - all features
IPv6 on
DEBUG off
Sensor App
SLEEP on
(Cannot build IPv6
coordinator on AVR
target)
21138 bytes FLASH
1901 bytes SRAM 19280 bytes FLASH
1356 bytes SRAM
Raven without Ipv6
IPv6 off
DEBUG off
Sensor App
SLEEP on
13354 bytes FLASH
2377 bytes SRAM 15218 bytes Flash
1093 bytes SRAM 13208 bytes FLASH
548 bytes SRAM
Raven Minimal Size
All options off
RUM network only
8864 bytes FLASH
1875 bytes SRAM 7984 bytes FLASH
568 bytes SRAM 5716 bytes FLASH
412 bytes SRAM
SAM7X Coordinator
IPv6 on
DEBUG on
Sensor App
SLEEP on
102K bytes FLASH
17K bytes SRAM
3.4 Fuse settings
The fuses for the AVR platforms vary on the target microcontroller. These fuse
settings have been listed below for the appropriate platforms. These fuse settings can
be entered into the target of choice using AVR Studio or AVR Dude for command line
operation.
Raven (1284p): 0xFE; 0x91; 0xE2
Raven LCD (3290p): 0xFE; 0x91; 0xE2
Raven USB: 0xFB; 0x99; 0xDE
ZigBit/ZigBit900: 0xFE; 0x91; 0xE2

AVR2070
11
8240B-AVR-06/09
4 AT91SAM7X-EK RUM Quickstart
The Atmel RUM protocol is integrated to run on the AT91SAM7X-EK board which
contains an AT91SAM7X256 microcontroller. Additionally, the IPv6/6LoWPAN layers
can be compiled in. Compiling in the IPv6 layer will allow the SAM7X platform to act
as an IPv6 Edge Router in addition to an 802.15.4 PAN Coordinator. Furthermore, the
SAM7X platform supports all the Atmel 802.15.4 transceivers: AT86RF230,
AT86RF231 and AT86RF212.
The PAN Coordinator performs the classical functions defined in section 5.3 of the
IEEE 802.15.4-2006 specification. It will start and maintain a non-beaconing network.
The edge router functionality will route IPv6 network traffic to the appropriate end and
router nodes based on their specific IPv6 addresses. The RUM protocol
implementation differs slightly from the IEEE 802.15.4 standard. Please have a look
at the documentation of the Route Under MAC (RUM) Protocol described in Appendix
A.
The SAM7X provides multiple interfaces for users to interact with the 802.15.4
wireless network. Among these are RS232, USB, telnet and simple direct web
interface. The remainder of this section will describe the implementation of low level
drivers, radio drivers, timers, uTasker RTOS integration and web interfaces.
4.1 uTasker RTOS
To jump start development and provide a solid foundation for ARM operation, the
uTasker RTOS was chosen to build upon. uTasker is not a pre-emptive type RTOS,
rather it is a task-event-state driven type. A task was created called RUM Task that is
responsible for processing radio events as well as timer events associated with the
radio protocol. For a complete description of the uTasker RTOS visit
www.utasker.com.
In addition to RUM, IPv6, and 6LoWPAN, a FAT file system has been integrated into
the uTasker system. For more details see www.efsl.be and the Doxygen
documentation. RUM and IPv6 are described accordingly within this document.
Most of the RUM application code to interact with the uTasker RTOS is located in:
•rumtask.[c/h]
•arm_app.[c/h]
Most of the RUM stack shares the same code base between the SAM7X and the
AVR microcontroller platforms. There are, however, specific files that only pertain to
the ARM build or the AVR build. Low level files specific to the SAM7X build are:
•arm_timer.[c/h]
•arm_timer_event.[c/h]
•hal_arm.[c/h]
Additional modifications are:
•Enabling a telnet and a user menu interface.
•IPv6 and 6LoWPAN
•The EFSL FAT file system
See section 3.3 for specific build size of uTasker and RUM compiled for the SAM7X.

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. If access to the uTasker source code is required, a license
can be acquired via www.utasker.com. uTasker offers excellent licensing programs at
no or minimal cost.
With a license to uTasker, the source code can be patched to implement the RUM
architecture. These modifications add support for the RUM system and user
interaction. For instance, a user interface or menu system allows the user to change
the operating channel and other radio values. The code modifications can be found in
these files:
Application Level:
•application.c
•application.h
•config.h
•TaskConfig.h
•app_hw_sam7x.h
•debug.c
•webInterface.c
•types.h
Stack Level:
•Tty_drv.c
•driver.h
•Ethernet.c
•ppp.c
Since uTasker is provided in source code form, patch files have been produced for all
modifications needed to implement RUM with uTasker. To implement the patch files
the following procedure should be followed.
1. Download and Install WinAVR from www.sourceforge.net which provides the
patch.exe program needed to patch the uTasker project with RUM source.
2. Open the uTasker OS source code package (only available with a uTasker
license from www.utasker.com).
3. Be sure to download uTasker SP4 and apply the service pack to the original
uTasker OS source files. (Explained on uTasker website - simple copy and
replace files to apply service pack)
4. After the service pack has been installed, locate the upatch.bat and utasker-
patch files in the \patch folder within the source download package.
5. Copy these files to the same directory containing the uTasker OS with SP4
(eg. C:\project\... should contain these two files plus uTasker directory).
6. Using Windows Explorer, double click the .bat file to patch the uTasker
source for use with RUM. Note: Only run this patch procedure once.

AVR2070
13
8240B-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 the IDE of choice. Appendix D explains two
common IDE’s that can be configured to compile uTasker with RUM support.
4.2 Radio Interface
The radio interface is composed of two parts - hardware and firmware. The hardware
is generally a radio board with physical connections to a microcontroller with the
firmware to manage the interface between the two.
4.2.1 Hardware
In order to connect one of the AT86RF2xx transceivers to the microcontroller of
choice, the following diagram shows the generic connections needed to interface the
two parts.
Figure 4-2-1 Microcontroller to Transceiver Connections
There are various evaluation boards available that provide standalone transceiver
evaluation which provide header pins for easy connection to the AT91SAM7X-EK
board. See Appendix E for examples of connecting various evaluation boards.
This section highlights the required connections for the SAM7X and any one of the
three transceivers. Using the above generic connections, the AT91SAM7X-EK board
provides many GPIO pins for connection of the transceiver of choice. The table below
shows one method of connecting the two devices together with SPI1 and GPIO.
Table 4-2-1 AT91SAM7X-EK Connections
TRX Pin SAM7X
MCU Pin Port Port Function
MISO 56 PA24 SPI1_MISO
MOSI 55 PA23 SPI1_MOSI

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 TIOB0
SLEEP_TR 13 PA8 PA8
RST 14 PA9 PA9
4.2.2 Firmware
The low level driver code is located in two files:
hal_arm.c
hal_arm.h
These files initialize SPI-1 and the discreet IO. Additionally, these files implement
handler functions that the remainder of the code uses to interact with the radio. For
instance, radio interaction is accomplished through functions such as
hal_frame_read and hal_frame_write
for receiving and transmitting a frame over the air. Other functions such as
hal_register_read and hal_register_write
allow access to radio control registers. Please refer to the detailed documentation
produced as a result of the integrated Doxygen comments in each source file. The
radio registers are fully described in the files at86rf212_registermap.h and
at86rf23x_registermap.h.
4.3 Serial Interfaces
By default, none of the serial interfaces are enabled. Possible serial interfaces are
USB and RS232. (There are two RS232 COM ports on the SAM7X board.) The telnet
interface provides more than adequate user capabilities without the hassle of
configuring a serial interface such as Hyperterminal.
uTasker provides built in serial IO capabilities for RS232 and USB. To enable serial
IO for terminal interaction by the user the following defines can be enabled in
config.h:
#define USB_INTERFACE
#define SERIAL_INTERFACE
The baud rate parameters for the RS232 port are:
•19,200 BAUD
•8N1
To use the USB connection on a PC running Microsoft Windows, a Windows USB
driver must be installed. This USB driver is titled uTaskerAtmelVirtualCOM.inf and
can be downloaded from the uTasker website site at
www.utasker.com/software/softwareV1.3.html and complete documentation can be
found at www.utasker.com/docs/uTasker/uTaskerV1.3_USB_Demo.PDF. However,

AVR2070
15
8240B-AVR-06/09
the source code and precompiled code have USB disabled. Due to limitations on the
SAM7X board, if a reset is necessary, the USB cable must be removed and any open
USB terminal sessions closed and then the board can be reconnected and the USB
terminal session restarted.
4.4 Network Interfaces
uTasker also supports a telnet interface through the RJ45 network connector. The
telnet interface is nearly identical to the serial interface. It offers the same menu
selections and utilizes the default IP address of 192.168.1.125. This address can be
changed with the “I” menu selection. The network interface also provides the
connection for the on board simple web server.
Figure 4-4-1 shows an example menu interface. The complete menu commands are
fully described in Table 5-1.
To access the telnet interface, the RJ45 cable can be connected directly to the PC's
network interface card or to a hub/router.
Note:
If connecting a PC directly to the SAM7X, the Network Interface Card
(NIC) on the computer will need to be configured to communicate on
the same IP subnet as the SAM7X.
To start the telnet session simply type “telnet 192.168.1.125” at the DOS prompt and
press enter. Alternately, on a Linux machine, type “telnet -e / 192.168.1.125” at the
terminal prompt and press enter. The “-e /” defines the escape character. Once the
telnet session is started, type “/” and a telnet prompt will appear “telnet>”. Type “mode
line” and press enter twice to return to the SAM7X telnet session. The “mode line”
command forces the Linux telnet session to echo characters typed by the user to the
telnet screen.
Figure 4-4-1. Main Menu
4.5 AT91SAM-ICE
The ARM®is programmed via the AT91SAM-ICE JTAG adapter, see the web site:
www.atmel.com/dyn/products/tools_card.asp?tool_id=3892 for more information on
this device. For Linux based systems the CrossConnect JTAG device is
recommended, see the web site: www.rowley.co.uk/arm/CrossConnect.htm for more
information on this device.

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 Program
In order to load the uTasker RUM demo, the AT91SAM-ICE comes with a SAM-BA®
programmer GUI interface. This needs to be installed on the local PC that is directly
connected to SAM-ICE JTAG device. The software can also be downloaded from
www.segger.com/download_jlink.html. Various methods to program the AT91SAM7X-
EK target have been explained in Appendix D, but his method only describes the
SAM-BA method.
The SAM-ICE JTAG should first be connected to the USB port of the local PC. This
USB driver can be found with the SAM-BA download package. Provided the SAMB-
BA package has been extracted to the local PC, the USB driver should be installed
automatically.
Once the SAM-BA v2.8 program has been successfully installed, open the program
and see the image shown in figure 4-6-1.
Figure 4-6-1 SAM-BA Opening Message
This pop-up window allows the selection of the SAM-ICE JTAG device connected to
the local PC. Click the “Connect” button to continue.
The next screen allows for the uTasker RUM demo .bin image to be selected for
programming into the AT91SAM7X256. The .bin file can be found in the \bin folder of
the source code package.
Note:
The FLASH tab is selected as the image needs to be loaded into the
flash location of the AT91SAM7X256. Be sure the FLASH address is
set to 0x100000.

AVR2070
17
8240B-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 JTAG unit to the AT91SAM7X-EK development board. Power on the target and
press the “Send File” button.
The programmer will begin communication with the AT91SAM7X-EK board and a lock
region message should pop-up shown in figure 4-6-3.
Figure 4-6-3 SAM-BA Lock Regions
Simply select the “No” button to begin programming. Upon completion of
programming the target, the SAM-BA interface can be closed which will disconnect
the SAM-ICE JTAG programmer from the AT91SAM7X-EK board causing a RESET.
The uTasker RUM demo should initialize and begin flashing the DS1 LED on board
the evaluation kit at a rate of ~ twice per second.
4.7 Simple Web Interface
In order to connect to the simple web interface, the webpages must first be loaded
into the SAM7X via FTP. In the source code package, locate the \web_pages folder
and notice the simple webpage files. If running Windows, open and run the
Copy_all.bat file to initiate the FTP transfer. This can be manually done for command
line operation.

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 browser of choice to show the main webserver
page.
The simple web interface provides a quick and easy method for allowing the user to
find IPv6 address of the edge router (SAM7X) as well as the IPv6 addresses of the
connected nodes (provided the devices had code compiled with IPV6LOWPAN=1).
Additionally, a node can be pinged via its short address. Simply enter the
hexadecimal address into the ping address box and click the ping button.
Figures 4-7-1 and 4-7-2 show both pages of the simple web interface.
Figure 4-7-1 Simple Webserver Main Page

AVR2070
19
8240B-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 formatted as FAT32. Note
that the SD file handling is rudimentary. Users needing more advanced file handling
can adapt the system as source code is available. See the files in the directory path
“../utasker/Applications/uTaskerV1.3/efsl/”. This file system was adapted from
www.efsl.be please refer to the originators for comprehensive details.
For the RUM demo described in the next section, it is recommended to initialize
(reset) the SAM7X with the SD card inserted. This will allow the EFSL to properly
initialize the data logging feature. In Table 5-1, the SD card handling commands are
described to demo operation.

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 IPv6 is described in this section. It is assumed there is only one
PAN Coordinator per network and the PAN Coordinator can be either the
AT91SAM7X-EK board with radio interface, or another small AVR 8-bit based
platform described in section 2 (see Appendix E for third-party platforms).
Note:
If an AVR based platform is selected, there is no Ethernet interface
directly supported, just the optional serial interface. Therefore, any
Telnet and Webserver communication will not be available for network
control.
5.1 Operation
A PAN Coordinator will start a network by first locating a clear channel to begin
operations on. The PAN Coordinator will select a random PAN_ID, unless a static one
has been defined during compile time, and will begin accepting association requests
from router and end nodes. This mechanism is very similar to that described in
section 5.3 of the IEEE 802.15.4-2006 specification.
5.1.1 Network Formation
The network formed by the RUM protocol is a non-beaconing network. After the PAN
Coordinator has selected a channel to operate on, other nodes can begin to join the
network. The PAN Coordinator will issue beacons in response to beacon requests.
When a node wishes to join the network, it will send an association request to the
PAN Coordinator and the PAN Coordinator will respond with an association response.
From this, the node will retrieve its own short address. For more details about the
RUM protocol, see Appendix A.
5.1.2 Application Interface
The typical user interface to a running system with the SAM7X is the telnet menu
described in table 5-1. If an AVR platform is used as the PAN Coordinator, a different
menu is available via a serial interface described in table 5-2. The simple web server
will show a simple network table and allow the user to ping a specific node.
In order to communicate with the SAM7X telnet menu via the default IP address, see
section 4.4 for a description on how to configure the SAM7X and the local PC.
5.1.3 Main Menu
The telnet and serial menu selections are meant to be self descriptive however a
more detailed description is offered here.
Note:
Many of these are only available with the compile flag APP=SENSOR.
Also, for the ARM some of these require the compile flag
IPV6LOWPAN=1.
Table of contents
Other Atmel Network Hardware manuals