Sunteți pe pagina 1din 8

CSCE 896 Embedded Systems:

Lab 2 Assignment

Christopher Assi

Dr. M.C. Vuran


Assistant Professor
Department of Computer Science and Engineering
University of Nebraska-Lincoln

February 26, 2010


I. Introduction

The goal of this lab assignment was to make acquainted with the use
of TinyOS 2.x in a Linux Environment. A toolbox of software templates
was built for the remaining of the lab activities.

II. Application 1: Output

For the Output application, first the template application from the lab 1
assignment had to be copied. Instead of just sensing, the mote had to
interact with the environment with an output command.

Component: OutputAppC

a) MicaZ

For the MicaZ platform, every time the Counter equals “000”, a digital
output port is set to HIGH; otherwise, it is set to LOW.
The MDA100 sensor board was used for the MicaZ for the tests.

b) TelosB

For the TelosB platform, every time the Counter equals “000”, a digital
output port is set to HIGH; otherwise, it is set to LOW.
TelosB directly was connected to the U2 connector.

c) Process for MicaZ and TelosB

make micaz install,0 mib510,/dev/ttyUSB0


java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB1:micaz

1. MicaZ (MDA100 sensor board)

The pin D6 (CCA) was used. The low voltage was around 1mV and the
high was only
at 1.8V. (The low fluctuated when the LEDs changed too). The pin
D6(CCA) was set
as output before setting it.

2. TelsoB (the *AppC.nc file had to be changed).


In addition to the change made on the AppC.nc file, update also had to
be made on the *C.nc file as well
The low voltage ranged between 1 and 8 mV (depending on LEDs)
The High voltage was at 3.1 V (on pin 6: I2C Clock)

make telosb install,1


java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB0:telosb

Below was the result recorded after the command was properly
executed.
Figure1: Screenshot showing when the port output is set to HIGH and LOW

III. Application 2: Flash

For the Flash application, first the template application from the
previous problem had to be copied. A counter called CountFlash was
incremented every 5 seconds and its value was stored in the Flash
memory.

Instead of creating a second application to read the Flash memory and


check if the counting was correct, the following scheme was used:
When the mote was powered ON for the first time, the application
wrote in the first Flash memory address a “symbol” to mark that the
memory was not empty. The value of CountFlash then was written in
the sequential positions.
When the mote was powered ON again, the “symbol” was found in the
Flash memory. Therefore, the application read the first 20 positions of
the Flash.

Component: FlashAppC

a) Process for MicaZ and TelosB

make micaz install,0 mib510,/dev/ttyUSB0


java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB1:micaz

1. Tutorial.

Need xml file to indicate what we are calling each part of memory:
MicaZ: volumes-at45db.xml
TelosB: volumes-stm25p.xml

The micaz was completed with much complexity. The problems faced
were understood.

2. TelosB

The XML file was copied, but still had some other problems. The
tutorial code for both TelosB and MicaZ were being compile without
problems.
On the other hand, my code had some errors. The difference was the
use of the PrintF. Beside that file, the *AppC.nc files are identical.
Moreover the blocks need to be of size
multiple of 2^16 and cannot monitor the serial while you program the
TelosB.
It also takes longer to write to the TELOSB memory.

Below were the values of the CountFlash.

Figure2: CountFlash values


IV. Application 3: CountToRadio

For the CountToRadio application, first a CountTX and a CountRX


directory had to be created with the copy of the template application
from the previous problem. Two nodes were used: Node A and Node B.
The Node A had the application CountTX and, Node B, the application
CountRX.

1. CountTX

CountTX realized the counting with the variable Counter (0 to 7). The
values of the Counter were sent to the LEDs of Node B, in addition to
the local LEDs.

make micaz install,0 mib510,/dev/ttyUSB0


java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB1:micaz

make telosb install,1


java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB0:telosb

a) Tutorial

BlinkToRadio has to be executed before proceeding with PrintF,


otherwise it will not compile if you do.

b) TelosB:

Test TX with TelosB and put down RX with MicaZ to see if they still
communicate.

TelosB could TX to MicaZ

RX received from MicaZ

TelosB to TelosB works as well, but will not TX with only


batteries.

2. CountRX
CountRX did not have its own counter or any timer. It allowed the Node
B to receive the counting value from the Node A and displayed it in
the local LEDs.

make micaz install,0 mib510,/dev/ttyUSB0


java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB1:micaz

make telosb install,1


java net.tinyos.tools.PrintfClient -comm serial@/dev/ttyUSB0:telosb

a) Tutorial

BlinkToRadio has to be executed before proceeding with PrintF,


otherwise it will not compile.

Figure3: Counter from Node A

V. Conclusion

The lab experiment gave an overview on the use of an output port, the
use of Flash memory, and the use of the radio communication stack.
On the output, the application had to interact with the environment
with an output command. The MDA100 sensor board was used for the
MicaZ for the tests and theTelosB directly was connected to the U2
connector. On the Flash memory application, A counter called
CountFlash was incremented every 5 seconds and its value was stored
in the Flash memory. The blocks needed to be of size multiple of 2^16
and could not monitor the serial while you program the TelosB. It also
took longer to write to the TelosB memory. On the CountToRadio
application, a CountTX and a CountRX directory had to be created.
BlinkToRadio had to be executed before proceeding with PrintF,
otherwise it would not compile.

S-ar putea să vă placă și