The following sections describes how to get started the 8051wg platforms. Before you begin make sure that you have installed TinyOS and the 8051wg platforms. See download and install for more.
The current releases signal a functional port, yet it is far from complete and
requires more testing. In particular the following features are not
available at this time:
- The AM stack of TinyOS is unsupported at this time. Radio support is provided via SimpleMac
- Serial stack unsupported (uart support is provided as well as the simple StdOut print interface).
- The Keil compiler is recommended. The port has been written and tested using this compiler. Other compilers may or may not cause problems.
- Only the CC2430 is support, we expect Nordic Semiconductor nRF24E1 to be added later.
1. Resources
The following sources provides more detailed information on the background and implementation of TinyOS 2 on 8051 platforms.
TEP121 Towards TinyOS for 8051
Poster from TinyOS Exchange 4
Prentation from TinyOS Exchange 4
2. Detailed Features
The current version supports the following features:
- Texas Instruments CC2430 support for a wide range of TinyOS 2 drivers, including radio, adc, timers, and more. Two platforms supported:
- Compilation using one of 3 compilers:
- Windows and Linux development environments
- Native Linux support, Windows support through Cygwin
- Stand alone inline support developed by Will Archer and Nathan Cooprider from John Regehr's research group at University of Utah
2.1 TinyOS interfaces:
- Radio
- We export the radio using a straightforward SimpleMac interface. This interface is well suited for the 802.15.4 packet-based radios of the CC2430. It allows to send and receive packets, and set various 802.15.4 parameters as well as duty cycling the radio. Note that we depart from the Active Message abstraction promoted by the TinyOS 2.0 core working group. Our SimpleMac implementation supports simple packet transmission, but does not provide routing, or retransmission. Implementing Active Messages is future work.
- Flash
- We export the flash using the SimpleFlash interface that allows to read and write an array of bytes, as well as delete a page from flash. Note that this interface is much simpler than the abstractions promoted by the TinyOS 2.0 core working group (volumes, logging, large and small objects). We adopted this simple interface because it fits the needs of our data acquisition application. Implementing the core abstractions as defined in TEP103 is future work.
- Timer
- The timers are exported using the generic TinyOS Timer interfaces Alarm and Counter. These two interfaces give applications access to hardware counters and allows the use of the TinyOS components to extend the timer width from 16~bit to 32~bit. Note that on the pre-release CC2430 chips we used for our experiments, timers do not work properly (The timers miss events once in a while. This error is documented on a ChipCon errata, which is not publically available).
- ADC
- The Analog-to-Digital Converter is accessed through the core Read interface that allows to read a single value. In order to read multiple values, an application must issue multiple read calls or use DMA transfers.
- Pins
- The General IO pins are exported through the core GeneralIO interface, that allows to set or clear a pin, make it an input or an output.
- UART
- The UART is exported using the core SerialByteComm: interface (that sends and receives single bytes from the UART) and StdOut interfaces (that provides a printf-like abstraction on top of SerialByteComm.
2.2 TODO
- nRF24E1 support
- Support for sleep modes
- Precise timers (pending final silicon revision)
- Serial Stack (support the components PlatformSerialC, and UartC and the interfaces UartStream. UartByte)
- Active Message (AM) networking stack
3. Compiling applications
TinyOS users will find the environment familiar, the platform is programmed like any other TinyOS platform and compiled using the new platform names.
For example to compile an application
make cc2430em
Or for Sensinode Nano
make nano
3.1 Using Inline
The inline tool distributed along with this tool is documented in the README.inline file and here. The tool is executed as a pre compiler step between NescC and the 8051 compiler, to run it simple add the target inline to the commandline.
make cc2430em inline
The inlining algorithm is tuned using a few command line arguments (run
utah-inliner.pl and
cilly.exe for full list). In particular the flag
--auto honors the inline annotations from NescC while
--smart uses a heuristics to decide when to inline. The arguments are passed to the inliner using the environment variable
INLINE_FLAGS the default flags are as follows:
export INLINE_FLAGS = --8051 --auto --clean --shorten
3.2 Extra targets
The 8051 platforms define a few additional targets in addition to inline that can be added tot he command line. For example to cleanup any additional files created by Keil run the "clean" extra target:
make cc2430em clean
For further information run
make cc2430em help
3.3 Example applications
To get you started with the platform a few example applications have been provided (see below for full list). Here we will describe a few of them. For all of them compile them as above or with
3.3.1 Echo
This application receives characters from the UART and sends them back. Compile and install the application and connect a terminal emulator to the serial port (230400 baud, 8n1) and type away.
3.3.2 TTXDemo
This application is split in 3 parts:
- A mote samples an analog sensor and sends it wirelessly to a base station
- The base station passes the reading to a PC via a UART
- The PC displays the reading on the screen

The README file provided with the application gives full instructions.
3.3.3 CompressionTest
The CompressionTest compresses data on a mote using one of 3 algorithms: lz77, huffmann or simple. The data is sent from a PC that also records the timing. It has two parts:
- A PC side sends data to the mote using the UART and records the timing.
- The mote receives the data, compresses it and sends it back
The README file provided with the application gives full instructions.
4. Code Overview
You can browse the code online here, download a copy. The code is located under the DIKU projects in the TinyOS contrib section. The code is split in 3 places: the mcs51 specific, sensinode specific and platform independent (common). A few simple examples are provided in the mcs51 section, more elaborate examples are provided as part of the "common" section of the . The Sensinode Nano platform is provided in the sensinode section.
3.1 mcs51
mcs51
+--apps
| +--Test2430All - Simple test app.
| +--Echo - Echo chars from UART
| +--BlinkNoTimerTask - Blink leds without the use of timers
+--support
| +--make
| +--cc2430em.target - T2 .target definition
| +--mcs51
| +--mcs51.rules - Make rule definitions
| +--CC2430-F128.bat - Keil compile scrip
| +--cilly.exe - UTAH inliner
| +--utah-inliner.pl - Wrapper script for UTAH inliner
| +--clean.extra - Additional cleanup
| +--inline.extra - Make rules for inline
+--tos
| +--platforms
| +--micro4 - Micro4 platform definition
| +--nano - Nano platform definition
4.2 Sensinode
sensinode
+--tos
| +--platforms
| +--nano - Nano platform definition
4.3 Common
common
+--apps
| +--TTXDemo - 3 part sample, forward, display app.
| +--README - Instructions on how to compile and run
| +--SampleForwardBase - Base station with serial connection to PC
| +--SampleForwardNode - Wireless sample, forward mote
| +--PC_display - PC display app.
| +--CompressionTest - Compress data from UART
| +--README - Instructions
| +--TestSimpleMac