I have all kinds of bits of code that I would like to distribute, but have never gotteen around to putting into a neat little package that is nice enough to be put online. After thinking about putting these projects into a presentable state for a number of years, I have decided that my best bet is to advertize them, to see if anybody is interested. If something in here interests you, don't hesitate to send me an e-mail, and I will be pleased to send you what I have.
Battery charge/discharge monitor
This project uses a PIC microcontroller to monitor the charge and discharge of my RC airplane batteries. It can be used to evaluate the battery's capacity, and to make electrical power measurements when the plane is operating.
Module version of Badram
My laptop has a few defective bits in RAM. Rick van Rein's Linux kernel patch allows defective bits to be marked as reserved so that they will not be used, but it requires a kernel recompile. To speed upgrades, I prefer to run the stock Ubuntu kernel and have this functionality provided by a module. This is possible because in many cases defective RAM bits are at a high enough address that they are not used early in the boot process before the module is loaded. Sadly, this code is highly dependent on the internals of the kernel slab allocator, so it only works for a narrow range of kernel versions (2.6.15 works, 2.6.24 does not). The source is available here.
MEMS mask preview
Autocad seems to be the tool of choice for MEMS mask design at MIT's MTL. Unfortunately, it is most effective for working with contours, rather than surfaces, and knows nothing about how multiple masks will be combined into the final 3D product. This little OCaml application loads a set of masks (DXF), and allows them to be displayed in a way that makes sense. It can show each individual mask (rather than edges), create a synthetic view of multiple masks, allowing feature alignment to be checked, and create a side view to check that all the features are placed on the correct mask. Using this software requires a bit of OCaml programming to specify the views for a specific mask set, after which the masks can be viewed using a GUI. This application caught many bugs while working on my PhD thesis devices, and was used to generate some of my thesis figures.
DXF to povray conversion
I couldn't find any software to convert a polyline in DXF format into a spline for use in a povray polygon or prism object, so I wrote a simple converter myself. It uses the dime library to import the DXF file, then outputs a linear spline that can be included into a povray file. It supports multiple closed polylines and circles. Very primitive for now, but gets the job done. The source is here.
FPGA Identification
For my Masters thesis, I co-invented Physical Random Functions, which allow an integrated circuit to be securely identified without relying on any information stored digitally on the circuit. Our implementation of Physical Random Functions uses precise measurement of circuit delays. The first prototyping was done using Xilinx FPGAs, and the resulting demo was able to to distinguish between the few dozen FPGAs we had available. This work is now being developped into a product at Verayo. To make this demo work from a standard smartcard interface, I wrote some code to allow the FPGA to be recognized as an ISO7816 compliant smartcard.
Video Pipes
Using the Video4linux interface (/dev/video) only one application can use a webcam at a time. Video pipes offers a way for streams of images to be usable by multiple programs simultaneously, making your webcam (and any other image source you may have) accessible to many programs at once.
HC11 Tools
I have some tools to program a Motorola HC11-F1 through the serial port. They are written for linux, but should be easy to adapt for other OSes. My main consideration in writing them was speed, so they go significantly faster than some commercial implementations that I have seen, particularly when writing in RAM (these were mainly used to program a ZeroPower RAM).
XDS510 Simulator
Texas Instruments has some pretty cool DSPs. But programming many of them requires TI's XDS510 JTAG interface, that TI unfortunately sells for a horrendous (for a hobbyist) price. I have written an extension to Wine that enables TI's programming tools to function by using a software-simulated XDS510, and a trivial parallel interface. I have tested this system with the TMS320F241, but it should work with many other models, as long as the same XDS510 features that are used by the programming software are those that I have implemented. If you want to program an XDS510 cheaply, this is the thing for you. If Wine is a problem for you, the code that I have written can be adapted to TI's software in other ways. Don't hesitate to ask me for more information.
FPGA Computer
This was a class project for an FPGA class, done with François-Marie Lefevere. I have rarely had this much fun. We were given a Pamette FPGA board and told to do something. First we made a video card with hardware polynomial deformations to get a feel for things on the first FPGA. Then we made a stack-based risk processor that fit on the second FPGA, and wrote the corresponding assembler and a compiler for a simple Reverse Polish Language. A co-processor was added for multiplication on the third FPGA. The last FPGA was used for routing, and as a keyboard-mouse interface. This was completed with a simple presentation application which we used for our final presentation. The whole presentation could fit in video memory as text. The processor was responsible for either editing the video memory or for transitioning from place to place in video memory with suitably selected rotations or deformations.
Ubicom (formerly Scenix) SX programmer
I have hacked up a number of variants of the Fluffy programmer, that work under Linux, and that use a simplified programmer interface (the PIC's job is done by the PC). This code is based on a fairly old version of Fluffy, so I don't know if it will work with more recent chips.
Dust, a Simulator for the SX in a Digital Circuit
This class project is an interactive circuit simulator, in which the SX is just another component. Many SXes can be included in the simulation. There is a very library of other components that can be placed around the SX in the circuit. The library is small, but can be extended quite easily. The drag and drop interface, available for Linux and Windows, allows the user to choose how the variables are displayed. This simulator was originally designed to be able to simulate a SX-controlled servo loop, so one of the built-in components is a motor connected to an encoder. English documentation is available. This project was done with François-Marie Lefevere.
You can download the Linux or Windows versions. Note that the Windows version is known not to compile as is with recent versions of Borland C++ Builder.
Two-motor PID Servo Control Software
A SX 18 can be used to control two motors, using PID servo control. I have implemented this in assembler, with SPI (synchronous serial) communication to receive control orders. If used to control 2D motion with two parallel wheels, the SX can also calculate the position of the robot. This code was used two years in a row to control the Ecole Polytechnique's robot in the E=M6 / Eurobot robotics contest.
Documentation is available in French.
The documentation and code are here.
C-like compiler for the SX18/28
Another class project with François-Marie Lefevere. It is a compiler for the SX, with a number of optimizations. It is written in OCaml, with its structure based on Didier Remy's compiler class at Ecole Polytechnique. The interesting feature of this compiler's language is that it is easy to do calculations on arbitrary groupings of bytes, to split bytes and recombine them. The compiler still requires quite a bit of work to become usable as it has barely been debugged and lacks arrays.
The OCaml code can be downladed here.