BitCloud Sample Applications

Several demo programs are provided with the BitCloud Software API in order to demonstrate how to develop user's applications.

System requirements

The BitCloud sample applications are intended to run on MeshBeans and other compatible platform devices.

System requirements for the PC used to compile applications and program the nodes are:
PC
CPUIntel Pentium III or higher, 800 MHz
RAM128 MB
Hard disk free space50 MB
Software
Operating systemWindows2000/XP
USB driver CP210x USB to UART Bridge VCP Driver
Java machineJava Runtime Environment JRE 5.0 Update 8 (version 1.5.0)
CompilerAVR GCC 4.1.2 compiler available within the WinAVR 20070525 package.

To upload the firmware to the boards, you may use either JTAGICE mkII emulator in conjunction with AVR Studio or the Serial Bootloader utility.

How to build

Source codes of all sample applications along with the corresponding configuration files are given at [ZDK]\Sample Applications\. Hereafter, [ZDK] denotes the root folder for ZDK installation. The compiled firmware image files are also contained in the same directory. However, it is not necessary to retain these files, since you can rebuild them at any time.

The BitCloud library and Makerules files are contained at [ZDK]\BitCloud\lib\. The choice of the particular library to include is made at the time of compilation based on the application's configuration parameters.

To compile an application, run make utility from the directory where its Makefile is located:

make clean all
Otherwise, find the corresponding *.aps file in the same directory, open it with AVR Studio and just press Build\Rebuild All in the main menu. The *.hex and *.srec image files will be generated. Now you may upload one of the image files onto a MeshBean board.

Programming the Boards

The boards can be programmed in one of the two ways: either by Serial Bootloader utility, or under AVR Studio using JTAG emulator, for example, JTAGICE mkII from Atmel.

Fuse bits should be set to the following values (in hex representation): 0xFF, 0x9C, 0x62 (factory default) when using Serial Bootloader, or 0xFF, 0x9D, 0x62 when using JTAG.

To learn more, see the Serial Bootloader User's Guide or the ZDK User's Guide contained in this kit.

Connecting to PC

Most of the sample applications imply some interaction with a PC (although they may be run as well without connecting to PC, when the only observation of the state and activities of the boards is performed by their LEDs). While WSNDemo uses a special custom program named WSN Monitor, other programs need just a general-purpose terminal application. The connection parameters must be set as follows (unless stated otherwise for a particular application):
ParameterValue
Data Rate38400 bps
Data Bits8
ParityNone
Stop Bits1
Flow ControlNone

Configuration parameters

Most of the user-adjustable application's configuration parameters are isolated in a file named Configuration which is then included in the Makefile.

Channel selection

To select a channel to work on, the user may change the channel mask definition (APP_CHANNEL_MASK) in the application's configuration file, recompile the application and burn it into the nodes. By default, the channel is set either to 0x16 or to 0x18 for devices working in the 2.4 GHz band (ZigBit, ZigBit Amp) or to 0x00 for those working in the 868/915 MHz band (ZigBit 900).

Security

By default, the NWK layer security implemented in BitCloud stack is switched off. The compiled stack libraries are supplied in versions for coordinator, router, end device, and all devices. Each of them is presented in two variants: "Security ON" and "Security OFF", thus making a total of 8 libraries. The choice of a particular library to include when compiling an application is defined by the values of STACK_TYPE and SECURITY_MODE parameters in its configuration file.

To switch on the security in an application, one should perform the following changes in its configuration file: change the SECURITY_MODE value to STD_SECURITY and select one of the two following modes of operation:

Note that switching on security option enlarges firmware image, so that for some programs it may become too large to fit into the board's memory. In such case, the user may try to reduce it by decreasing CS_NEIB_TABLE_SIZE, CS_ROUTE_TABLE_SIZE, CS_MAX_CHILDREN_AMOUNT and other parameters that control memory allocation.


Generated on Tue Jun 3 12:45:19 2008 for BitCloud Stack Documentation by  doxygen 1.5.1-p1