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 {{[jump="mailto:blaise@gassend.com"] e-mail}}, and I will be pleased to send you what I have. P1: 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. !block inline !endblock P1: Module version of Badram My laptop has a few defective bits in RAM. Rick van Rein's {{[jump="http://rick.vanrein.org/linux/badram/"] 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 {{[jump="badram-module.tgz"]here}}. P1: 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 {{[jump="../publications/PhDThesisAFullyMicrofabricatedTwo-DimensionalElectrosprayArrayWithApplicationsToSpacePropulsion.pdf"] thesis}} figures. !block inline !endblock P1: 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 {{[jump="http://www.coin3d.org/Coin3D/file_format_libs/Dime/"]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 {{[jump="dxf2povspline.tgz"]here}}. P1: FPGA Identification For my Masters thesis, I co-invented {{[jump="../publications/MastersThesisPhysicalRandomFunctions.pdf"] 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 {{[jump="http://verayo.com/"]Verayo}}. To make this demo work from a standard smartcard interface, I wrote some {{[jump="http://www.opencores.org/projects.cgi/web/iso7816-3/overview"]code}} to allow the FPGA to be recognized as an ISO7816 compliant smartcard. !block inline !endblock P1: {{N[jump="videopipe/index.html"] 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. !block inline !endblock P1: 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). P1: {{[jump="xds510/index.html"] 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. P1: 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. P1: Ubicom (formerly Scenix) SX programmer I have hacked up a number of variants of the {{[jump="http://www.codepuppies.com/~ben/sens/pic/sx/"] 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. P1: 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 {{[jump="dust-linux.tgz"] Linux}} or {{[jump="dust-windows.tgz"] Windows}} versions. Note that the Windows version is known not to compile as is with recent versions of Borland C++ Builder. !block inline !endblock P1: 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 {{[jump="http://www.polytechnique.fr"] Ecole Polytechnique's}} robot in the {{[jump="http://www.robotik.com"] E=M6 / Eurobot}} robotics contest. Documentation is available in French. The documentation and code are {{[jump="ScenixPID.tgz"] here}}. !block inline !endblock P1: 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 {{[jump="http://caml.inria.fr/"] OCaml}}, with its structure based on {{[jump="http://pauillac.inria.fr/~remy/"] Didier Remy's}} compiler class at {{[jump="http://www.polytechnique.fr"] 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 {{[jump="sxc-source.tgz"] here}}.