The Work Itself
Diplomarbeit Ressourcenoptimiertes Netzwerkprotokoll für Miniatur-Sensorknoten
English Title:
An Optimized Physical And MAC Layer For Wireless Sensor Networks


Tools Created
keilbuild.pl
Builds Keil Projects using their .Uv2 files
keil2sdcc.pl
Converts Keil style header files to SDCC header syntax
program.pl
Programs compiled binary into CC1010 using Chipcon programmer
jEdit Commands
Command XMLs for the jEdit console plugin

Tools Used
jEdit
SDCC
Perl

Institutions
University of Karlsruhe
TecO
Chipcon
Free Software Foundation

Related Work
Embedded End-To-End Wireless Security With ECDH Key Exchange

Wisenet

They ported Berkley's TinyOS to CC1010

The RF Random Access Integrated Node
MIT design with the CC1010

Nettverksprotokoll for et kortholdsradio- kommunikasjons- system basert på CC1010 (Norwegian)
My Picture

Thesis Homepage of Patrik Spieß

last changed: ".date(date("Y-m-d, H:i:s", $lastChanged)); // --> ?>

This is a Blog about my diploma thesis that I am currently working on at TecO, an institution of the University of Karlsruhe in Germany. I will port most of the SmartIts Functionality to a new hardware platform, the CC1010 chip from Chipcon. The advantage will be a cheaper product - about 1/3rd of the cost of the current SmartIt design.

Hardware
I use the CC1010DK-868 development kit (DK). It includes a Evaluation Board which connects to the PC via parallel and serial port, and two Evaluation Modules (EMs), these are small daughterboards that can be connected to the Evaluation Board or be operated stand alone. The two EMs have the CC1010 chip mounted on them.
The CC1010 chip is a true system on a chip. It includes two serial ports, an RF (Radio Frequency) unit. With few external components you can implement a small wireless node. The only problem is it's energy consumption. Without optimization, it uses 15 to 28 mA at 3.3 V.

Software
On the software side, the DK is bundled with an evaluation version of the Keil compiler, which works for many 8051 based chips. Unfortunately, this version is limited to projects of 2 kB of object code, so even some of the examples won't compile because they are too big. Since the commercial version of the Keil IDE costs > 2000 € and educational discount is only 10 %, I decided to use SDCC (Small Devices C Compiler), an open source compiler that generates 8051 code. There are many application examples that give you a pretty good idea how to program the chip in C.

Meta
The project has been finished 31 August 2004. Since then, my thesis is available for download here (unfortunately only in German language).

You can also check out my regular home page at http://patrik-spiess.de, but don't expect much, it's quit outdated :). Feel free to email me at spiess_at_teco.edu (please correct address, altered to prevent scanning by spammers).

All tools on this page are released under the GNU Public Licence.
I am not associated with Keil Inc. or Keil Electronik GmbH.

BLOG

2004-08-30
It's done. One day before the official deadline my thesis is available online. The paper version in being bound by a copy shop. Unfortunately there were some minor additions to the PDF version after the paper version was printed out, so here is the best source to get the work. As I already said, I have to disappoint all the people who don't speak german as their first or second language: it is only available in German language. I will add an English abstract to this page soon. The actual work is available on the very top left corner of this page.
2004-07-12
Another LaTeX-Tip today: If you don't want to have those ugly hyperlinks in PDFs generated by pdflatex, which jump to the caption of a table or a figure, so that the figure you are linking to is not visible, because you have jumped under the actual figure and have to scroll up. Then use the hypcap-Package. In the MikTeX package manager you have to choose the "oberdiek" package, which installs hypcap and some other extensions. Use the following command to include the hypcap package just after including the hyperref package:
 \usepackage[<your options>]{hyperref} % generates hyperlinks e.g. for pdflatex
 \usepackage[all]{hypcap} % <== generates correct hyperlinks to figures and tables
 \usepackage{thumbpdf}
In my opinion this extension is so useful and the results are so undisputable that it should be added to the hyperref package.
2004-07-05
I admit, this is a bit off-topic, but since I heavily use LaTeX for creating my thesis, I also want to share the hard to debug obstacles I fought with in my LaTeX source.

If you use the figure environment to include graphics into your document, be sure to obey the correct order of commands:
\begin{figure}[htbp]
	\centering
	\includegraphics[width=0.90\textwidth]{logos/synchronisationZeitlich}
	\caption[Synchronisation]{Zeitlicher Ablauf der Synchronisation}
	\label{fig:synchronisationZeitlich}	
\end{figure}
The important thing here is that \label has to follow \caption, otherwise the numbers in your \ref commands will all mix up.
2004-06-01
People keep asking me by email if I have managed to get RF connections working with SDCC. The answer is: the "halRFTest" example did not work. However, I made another example that is working properly.

There is a "sender" which continously sends packets and an "receiver" which tries to receive them. The packet content is hard coded in both nodes, so the receiver can test if it received it correctly. If reception failed or the received content is incorrect, the red LED blinks, otherwise the green and yellow LEDs blink. Additionally, the scrambling algorithm of the 802.11 W-LAN standard is implemented (which makes transmission of NRZ symbols much more reliable).

You can download the code and the altered libraries in the file demo_checkout.zip. Be sure to use the correct the library, include, and compiler executable paths, e.g. by passing them to the compiler as command line options or use keilbuild.pl (zip-archive) together with the *.uv2-files supplied with the example. If you don't use keilbuild, you need to set the command line options specified in this script!
2004-03-12
I seamlessly integrated my keilbuild.pl and program.pl scripts into jEdit, the source code editor of my choice.

I did not know this editor before I started my thesis. But I found out that it ROCKS! Don't wipe it, because it looks awful after you installed it. You can configure everything and make it look really nice. I will never use UltraEdit or TextPad again. This editor can do everything they can, and a lot more. Be sure to read the "Tips of the Day". They give you very good clues on how to access the features of the program.

You can download the jEdit keilbuild.pl and program.pl integration files (zip file) for jEdit. Just follow the install instructions in README.txt.
2004-03-03 The program keilbuild.pl doesn't need sdccrun.bat any more for running. It handles options and paths internally which has the advantage, that the output can be modified after compilation (e.g. to get rid of the annoying 'unreachable code' warnings).

I found out that timer1 doesn't seem to run as expected. I programmed it to an interval of 20 ms, but the oscilloscope told me, the interrupt service routine (ISR)  was called every 16 ms. So I changed a factor in  ConfigTimer01.c. Now it works.
2004-02-25 New perl script for easy programming of the CC1010. It warns you if you try to program the same code twice if it has not changed in the meanwhile. Get it here: program.pl
2004-02-23 Never use Timer1 and UART1 together with the serial ports. This combination doesn't work!
2004-02-20 I just found out a very strange thing considering the watchdog timer of the CC1010 device. The watchdog timer resets the device if a special flag is not set by the software periodically. This is a good idea to prevent software hangs. But for the simple examples provided with the evaluation board, the timer is not needed and therefore disabled by almost all examples:

  // Disable watchdog timer
  WDT_ENABLE(FALSE);

These two lines can be found in each example source file. For some strange reason, they don't work with the latest version of SDCC. My application kept on resetting periodically, so I suspected the watchdog timer. First I thought it was timer0, because I had used it for the first time. But then (after studying assembler listings for two days) I started experimenting with the watchdog timer. Don't ask me why the original macro does not work. It produces the right assembler code. But the only code that worked for me was the following:

  WDT_ENABLE(FALSE);
  WDT= 0x13;

or

  WDT= 0x13; 
  WDT= 0x13;

I know setting the SFR
'WDT' twice sounds bizarre, but I don't mind, it works for me. Hope this saves you some debugging time.
2004-01-29 Made a tool to automatically build the examples shipped with the CC1010 IDE. I called it keilbuild.pl (zip-archive). Invoke it with the Keil project file to start building:

  keilbuild.pl ledSwitch.Uv2

It automatically detects if the source of any of the files has changed, and if necessary, compiles them again. It automatically composes the correct command line params for sdcc. I use a little .bat-file (sdccrun.bat) on Windows that sets all the command line options I need. They are optimized for the Chipcon CC1010 chip. You can download the file and modify it to your needs.
2004-01-29 Made a modification to the keil2sdcc.pl script which converts the header files for the Keil compiler into the SDCC format. It converts the files even better. The problem was: I had header files which define sfrs (Special Function Registers) like this:

  sfr at 0x80 P0;

and then later in the file, a sbit was defined like this:

  sbit at P0^0 P0_0;

The SDCC preprocessor doesn't like non-constant addresses for sbits. So my new version of the script remembers the previously defined sfrs and changes the second line to:

  sbit at 0x80^0 P0_0;

which works perfectly.

Here is the new file: keil2sdcc.pl (zip-archive)