DAC synthesis test Prototype board
[20 Aug 2016] Jane tree file generator

This program is a utility which takes host and parasite trees (in NEXUS format), and a link matrix (in CSV format), and generates an input file for the Jane cophylogeny reconstruction software.

[16 Jul 2016] UART AFSK radio receiver

Implementing a realtime AFSK receiver in software.

[ 6 Nov 2015] Enumerating fixed-weight bitstrings

Given the set of all bitstrings of length n with exactly k bits set, you can arrange them in lexicographical order. You can then convert between bitstrings and indices into this list. Can you do this efficiently when n is large and the list is too large to fit into memory?

[ 1 Sep 2015] Lightweight process supervisor for Linux

Rund is a lightweight stand-alone process supervisor for Linux. It takes an ordinary process and makes it into a supervised daemon, with automatic restart, rotating logs, and safe synchronized shutdown and startup. It doesn't require any installation, configuration files or special directory structures.

[ 9 Aug 2015] Android/SGX on the Gumstix Overo

This document explains how I, with some assistance and quite a bit of background research by Simon Guest at TracMap, got the PowerVR SGX drivers (3_01_00_03) working with Android 4.3 on the Gumstix Overo. What's described here isn't a finished product, but it's enough to get SurfaceFlinger up and running with hardware acceleration.

[19 Jun 2015] uFAT: small VFAT/FAT32 implementation

uFAT is small but feature-complete VFAT/FAT32 implementation. It supports all basic filesystem operations and has minimal memory requirements.

[ 8 Jun 2015] MSPDebug: debugging tool for MSP430 MCUs

MSPDebug is a free debugger for use with MSP430 MCUs. It supports FET430UIF, eZ430, RF2500 and Olimex MSP-JTAG-TINY programmers. It can be used as a proxy for gdb or as an independent debugger with support for programming, disassembly and reverse engineering.

[ 5 Apr 2015] Windows 32/64 cross GCC with C++11 threads support

This document explains how to build, on a POSIX system, a cross-compiling GCC targeting both 32 and 64 bit Windows systems, with C++11 threads support. It uses MinGW-w64.

[23 Jan 2015] Touch-screen filtering

Although the tslib library is often used on embedded Linux systems for touch-screen filtering, it can be done in a flexible and effective way in just a hundred or so lines of C++. The method described here has been tested on both a resistive touch-screen and a capacitative touch-pad.

[ 6 Jan 2015] Lightweight SQLite3 wrapper for C++

This pair of files implement a very lightweight wrapper for the public-domain SQLite3 database library. There are no external dependencies, apart from the SQLite3 library itself.

[24 Oct 2014] Simple HTML decluttering

Some time ago, I implemented a very simple Perl script for the removal of HTML boilerplate (advertising, comments and other clutter surrounding the content on commercial websites). The script is less than 300 lines long, and uses very simple a series of tree-processing algorithms which can be customized and tuned.

[14 Sep 2014] Fast multi-word software shift registers

This article describes a method of implementing fixed-size bit-queues, or shift registers, for very fast real-time operation. The method described is far faster and more flexible than shifting through multiple machine words.

[25 Apr 2014] Curve25519 and Ed25519 for low-memory systems

This package contains portable public-domain implementations of Daniel J. Bernstein's Curve25519 Diffie-Hellman function, and of the Ed25519 signature system. The memory consumption is low enough that they could be reasonably considered for most microcontroller applications. In particular, Curve25519 scalar multiplication uses less than half a kB of peak stack usage.

[14 Apr 2014] Simple and effective NOR-flash shadow paging

This package implements a simple and effective shadow-paging scheme for use with NOR flash or EEPROM. It allows small sets of data (such as configuration) to be stored atomically and reliably in the face of power and programming failures.

[29 Dec 2013] NaCl cryptography primitives for small MCUs

These are NaCl-compatible primitives optimized for use on small (8 and 16-bit) MCUs. They use a very small amount of stack space, at a modest performance penalty. The implementation is in the public domain.

[10 Dec 2013] Dhara: a small and reliable NAND flash translation layer

Dhara is a small flash translation layer designed to be used in resource-constrained systems for managing NAND flash. It provides a mutable block interface with standard read and write operations.

[ 1 Aug 2013] Anuweb: web interface for Totem

Anuweb is a Totem plugin which provides a simple web interface. Via the interface, you can control playback (play, pause, toggle full-screen, seek, etc.) and browse for files.

[31 May 2013] Static stack analysis with AVR-GCC

A static stack analysis tool for AVR-GCC (but portable to other architectures.

[19 Mar 2013] Introduction to asynchronous programming

This article serves as an introduction to asynchronous programming, explaining the differences between asynchronous and event-based programming, and describing some basic techniques.

[ 3 Jan 2013] Converting a PDF document to HTML

G.H. Hardy's autobiography, has been made available in PDF format by the University of Alberta's Mathematical Science Society. Attempts to convert the document to HTML using tools like pdftotext or pdftohtml yield poor results -- out-of-order text, missing paragraph breaks, unwanted page numbers and inconveniently placed footnotes. By extracting and examining all available typesetting information in a PDF, we can do a better job than this.

[29 Dec 2012] Saraswati: text-mode EPUB reader for Linux.

Saraswati is a text-mode EPUB reader for Linux. It is fast, small and easy to use.

[29 Dec 2012] Quirc: a fast and portable QR-code recognition library

QR codes are a type of high-density matrix barcodes, and quirc is a library for extracting and decoding them from images.

[ 7 Dec 2012] An std::map replacement with efficient range queries.

A summary map is a drop-in replacement for std::map with the additional property that it supports efficient computation of aggregate functions over contiguous ranges.

[28 Jun 2012] Katcat: Sanyo 6650 (Katana II) user data extraction

Katcat is a tool for extracting media files from a Sanyo 6650 CDMA phone (also known as Katana II) via the USB data cable.

[24 May 2012] Cdok: calcudoku puzzle generator

Calcudoku is a sudoku-like game invented by Tetsuya Miyamoto (marketed under the trademarked name "KenKen"). This program can be used to examine, print, solve and generate Calcudoku problems of any size up to 16x16.

[10 May 2012] Reliable packetization over a noisy serial line

Many peripherals still use raw UART-based protocols like RS-232 and RS-485, particularly in industrial electronics. Any protocol for communication over one of these serial lines needs to be able to cope with transmission errors and garbage.

[24 Jan 2012] Getcast: simple command-line podcast downloader

This script is a simple tool for managing podcast subscriptions. It doesn't use any global configuration or database. Instead, each subscribed podcast is kept in its own directory, which contains the downloaded media files. This is referred to as a podcast repository.

[24 Jan 2012] Miscellaneous patches

Often, libraries need to be modified before they can be used in an embedded system. These patches add or fix functionality for specific uses of various popular open source software packages.

[25 Oct 2011] A better FFT-based audio visualization

There are a lot of FFT-based audio visualizations available, but they usually make the mistake of displaying a raw FFT-based bar graph. This leads to a display which flickers wildly and doesn't appear to move in time with the audio. This problem can be fixed though, with a few simple modifications.

[25 Aug 2011] Robust I2C slave without a sampling clock

I2C is a popular two-wire serial bus protocol for communicating between devices. Most MCUs support it, so it's a good choice of interface for many chips. This article shows how to implement an I2C slave interface without the use of a bus sampling clock.

[13 Jun 2011] Generating difficult Sudoku puzzles quickly

This article explains a simple method to quickly estimate the difficulty of a Sudoku puzzle which correlates reasonably well with human estimates of difficulty. It also gives an algorithm which can be used to generate difficult puzzles reliably and efficiently. Source code for an implementation of this algorithm is also provided.

[ 8 Mar 2011] Pulse Density Modulation for software DACs

PDM is a method of continuously varying the average value of a digital signal, but without having a fixed modulation period, as in PWM. It allows generation of a time-varying signal in software with less CPU load than an equivalent PWM scheme.

[10 Feb 2011] Efficient aggregate computation on B+Trees

This article describes an enhancement to the B+Tree data structure which enables certain types of summaries to be computed on arbitrary contiguous subsets of a B+ tree in O(log n) time. The time complexities of the usual B+Tree operations for insertion and deletion are not affected, and still run in O(log n) time.