Update January 13, 2008

Bitwacker page

This page is for logging the development and implementation of the components needed to program the USB bit whacker device from Linux.  This development started at an "XP code sprint" on September 19.

First the preliminaries:

Some links for the basic URL's I used to get started:

http://greta.dhs.org/UBW/index.html
http://greta.dhs.org/UBW/FW/2455/B/B.zip
http://en.wikipedia.org/wiki/Intel_HEX
http://www.sparkfun.com/commerce/product_info.php?products_id=762
http://sdcc.sourceforge.net/
http://www.internetking.org/fsusb/
http://ww1.microchip.com/downloads/en/devicedoc/39632c.pdf
http://cheeseshop.python.org/pypi/IntelHex/0.9.0
spark fun forums

Boot loader:

I found a libusb driver + application boot loader thing on the web but I wanted to have a proper USB driver and a, hopefully, python firmware load application.  I used the "fsusb" loader application for guidance, along with the actual boot loader firmware source code on the PIC.

The current tar ball implements a unit test that confirms that I can program a new HEX file to the UBW.

Current project files: driver.tar.bz2MC_boot_loader_flash.tar.bz2  If you want a patch of the driver to build into you very one kernel see: http://marc.info/?l=linux-kernel&m=119895698202306&w=2  I don't know if I'm going to push the driver into the up stream kernel at this time.  If its just for me I'm not sure its worth the bother.

The driver code protects against writing to boot loader addresses, and the python FW upload program does the uploads and a verification step.  It still doesn't do anything with the config, or eeprom areas.  These are not needed for my use and I don't plan to do them, but if you have an itch to scratch and you add support for them let me know and I'd be happy to include your enhancements in the tarball.

SDCC tool chain bring up:

Starting with the Rick Bronson SDCC port linked to on the UBW web site; I cleaned up some of the Makefile and got rid of some of the unused files.  I am now using the following as my starting point: D_143_Dec8.tar.bz2
I also found I needed a newer version of SDCC than what I got from the Ubuntu apt-get install sdcc.  If you want to reproduce what I did start with
sudo apt-get install gputils
svn co https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc sdcc

Configure and make the sdcc, sudo make install, then go into the sdcc/device/lib/pic16 directory and edit the "pics.build" file to remove the lines with 2620, 2682, 2685, 4620, 4680, 4682, 4685, 8620, and 8680.  (They wouldn't build given the versions of gputils or sdcc source).  Now do one more make install to get the libsdcc.lib made and installed.

Next steps:

Take the starting point code and hack it up to implement the PIC application I had running on the 16f877.

comments, and advice welcome markgross@thegnar.org