SchmalzHaus logoUBW (USB Bit Whacker)
An inexpensive, simple input/output device to connect your computer to the real world.
By: Brian Schmalz

Early UBW Board pictureImage of UBW board44 Pin QFN UBW picture

Description:
The UBW board is a small board that contains a Microchip PIC USB-capable microcontroller, headers to bring out all of the PICs signal lines (to a breadboard for example), only costs about $15-$20 to build and is powered from the USB connection. I designed this board to be a simple parallel port replacement tool for Bruce Shapiro for use in his bits-to-bytes-to-bots class. Apologies to all other 'Whacker' projects like EDTP's Packet Whacker for stealing a great name <grin>. All tools used to design this project are free, and the design is open to anyone to use for whatever they wish. Please build your own and improve upon it! If you don't want to build your own, you can buy them assembled and tested from SparkFun in two varieties - a built and tested small surface mount board, or a larger plated through hole kit for $5 less. SparkFun hosts a USB forum where the UBW is a common discussion topic. If you have a question, it may have already been answered there.

Quick Start: Brian, help! I just bought (or built) a UBW, but I don't know where to begin. What should I do?
OK, it is not hard at all. You need to do the following steps: (assuming you are on Windows, with 2000, XP or Vista)

0) If you built your own UBW, you need to put the bootloader and firmware HEX files on your UBW first before you can proceed. See this page for help. If you bought your UBW, just proceed to step 1.
1) Download this file from Microchip and run it. All it does is to install a bunch of files under C:\MCHPFSUSB that you will need later.
2) Find a USB cable, and plug in your UBW to your computer.
3) Windows will scratch its head for a while and then ask you if you want it to try and find a driver for you, or if you want to tell it where to look for a driver. You need to tell it where to look for the driver.
4) Point windows to the C:\MCHPFSUSB\fw\Cdc\inf\win2k_xp_vista32_64 directory.
5) Let it install the INF file it finds there. When it is all done thinkingm and installing (and your UBW's light is slowly flashgin), go to the Device Manager (right click on My Computer and click Properties->Hardware->Device Manager), and look under the Ports (COM & LPT) section, and you should see a new serial port there. Note the COM port number.
6) Now open up your favorite serial emulator (The really awful HyperTerminal that comes with Windows, or my personal favorite: TeraTerm Web), and open up that COM port number you found in the Device Manager. (Make sure to disable hardware handshaking - use no handshaking at all in fact.)
7) Now  type the command "V" and press Return. You should get back a version string from your UBW that tells you what version of firmware it is running, and this proves that your UBW is working properly! Congradulations. Now go read the documentation for the version of firmware you have installed (see below) to learn about the commands you can use, or read about how to install new firmware using the bootloader here.

UBW News:
(01/31/09) I've now edited the nice projects that Alex Lee sent me so that they are location independant and comple (and work!) for UBW, UBW32 and Microchip's FSUSB demo board. See below for new set of files.
(01/23/09) Alex Lee has ported the Jan Axelson Generic HID demo to the UBW and UBW32! Here is the zip file for the project. In order to make it work, you need to replace ./microchip/Include/USB/usb_function_hid.h and ./microchip/USB/HID Device Driver/usb_function_hid.c as well. Thanks so much Alex.
(09/18/08) Greg Corson has pointed out a serious bug in the "BS" command in Firmware D 1.4.3. If you send any <CR> or <LF> bytes in the binary data section of them command, they get eaten by the command processing fuctions, and don't make it out to the I/O pins! This will get fixed in a future version.
(05/11/08) Updated Bootloader docs and this page with references to Microchip's USB Framework v1.3 (for INF files and drivers) and updated some FAQ entries.
(04/02/08) The bootloader code posted here didn't compile correctly (i.e. didn't fit into the boot block) with later versions of the C18 compiler. I've now updated the source code to compile properly with MPLAB 8.02 and C18 v3.12. See this SparkFun forum post for more info.
(03/07/08) Russ Hensel is looking for beta testers to help with a Java front end to the UBW. It sure sounds like a great idea to me. I don't know enough Java to help out, but maybe you do!
(03/07/08) Where is the 1.4.3 FW D source code, zip file, and hex file? Why, I guess I'd forgotten to put up a link to it. There are no changes to the commands from 1.4.2 to 1.4.3.
(11/02/07) Rick Bronson modified the 1.4.3 FW D source to compile under the SDCC compiler. Here is the source that he posted to the SparkFun Forum. Thanks a ton Rick and Polly!
(10/17/07) Added a simple digital input/output tutorial page.
(7/18/07) Updated the UBW PTH kit assembly instructions slightly. Also, UBW FW D v1.5.0 is in the works. If you want a sneak peak at what is being planned, check out this document. Nothing is set in stone yet, not all features are coded, the document is not complete yet, and I'm not sure when the final release will be.
(6/22/07) SparkFun now has UBW through-hole kits for sale! And they're only $20. Here are the assembly instructions.
(6/21/07) There appears to be a Mac OS X application for downloading new firmware to the UBW using the Bootloader.
(5/25/07) Added a page with links to other people's UBW based projects
(5/25/07) New release 1.4.2 of UBW Firmware D. Fixed RC output bug and changed USB connected LED flash rate. Also builds for 40 pin chips.
(4/2/07) Here is another helpful page on how to get Visa CDC support for USB PICs. And at the bottom of this post from the Microchip USB Forum are instructions on how to get the Bootloader to work under Vista.
(2/27/07) With Greg Allen's help, we now have an INF file that allows the UBW to work properly under Windows Vista. However, neither Greg nor myself is able to get the UBW to work properly in Bootloader mode under Vista. If you have any ideas, please let me know. See below for the VistaCDCInf file.
(2/26/07) Microsoft does not currently support CDC under Vista, so UBW boards will NOT be recognized by computers running Vista. If anyone has a solution to this problem (besides writing my own usbser.sys for Vista) please let me know.
(1/27/07) Added a 'Roadmap' page describing what's planned for future versions.
(1/27/07) Added new Liberty Basic RC servo demo application.
(1/27/07) Version 1.4.0 of Firmware D is released - RC servo output, fast strobed parallel output, other good stuff. Hex File, complete source code, project files in one zip file, and documentation.
(8/18/06) Version 1.3.0 of Firmware D is released - mainly a bug fix for the problem where 1.2 wasn't being recognized by windows. Hex file, complete source, and documentation.
(7/23/06) Something a lot of people have been waiting for - Analog Inputs (9 of them!). New Firmware D v1.2 supports this and several other nice new features. Check it out!
(7/23/06) Added SparkFun's bootloader HEX file to files section below. (Same as mine except for 20MHz rather than 4MHz resonator.)
(7/17/06) A new release of Firmware C (v 1.0) on the Firmware C documentation page. Now supports reading 6 input pins as well as writing 8 output pins.
(6/29/06) WOW! The most exciting news in a long time - you can now buy pre-assembled UBW boards from SparkFun. I'm not affiliated with them other than I am a long time, very satisfied customer. And now they're going to make and sell these UBW boards. How cool is that. They have been kind enough to also set up a forum for discussion of USB products, including the UBW.
(6/28/06) Here's a taste of the (very) simple 19 channel logic analyzer application I whipped up in Liberty Basic. This is super basic - it has a long way to go before it is polished. But it proves that you can use the Firmware D version to do something useful. Here's the source code.
(6/26/06) A small bug exists in FW D v1.1 that prevents the UBW from receiving data from the PC if it can't send to the PC. A new version (1.2) will be out shortly that corrects this problem.
(6/4/06) Firmware D v1.1 is now up and released. Posted pictures of the rest of the finished UBW designs (which are all working properly).
(5/9/06) Firmware D is now up. Got me some 28 DIP v5 boards running. Soldered down QFN, SOIC and TQFP parts. Pictures soon.
(3/23/06) Added table with board versions and links to files, along with new board information (new versions of each of the 4 board styles).
(3/21/06) Ordered third panel of boards from Olimex. Includes 44 pin TQFP, 44 pin QFN, new 28 pin DIP and 28 pin SOIC boards. I'll post all of the design files real soon so you can see all four boards.
(3/13/06) Second batch of boards built. Only one major problem with 28 DIP v4 - program button is almost impossible to reach!
(3/6/06) Got second batch of boards from Olimex (16 days) built up first 28SOIC V.3 board - it works!
(3/1/06) Added Firmware B (bootloader) documentation
(2/28/06) Added new GUI version of Liberty Basic UBW tester application
(2/21/06) Added more to FAQ and got 28SOIC files up for viewing.
(2/18/06) Sent out order to Olimex for another panel of boards. This time I will get 11 of the 28DIP V.4 boards and four of the 28SOIC V.3 boards on the panel. Last night I re-did quite a bit of the SOIC board to make it small enough to fit into the leftover space on the Olimex panel.
(2/16/06) UBW 28DIP V.3 is done, and 10 are built and all work well. Bootloader (B) is done. Simple CDC (Serial port emulation) parallel port replacement application firmware (C) is done. Sample Liberty Basic example is written.


UBW Hardware Versions Matrix

Schematic
Board
Picture
Guide
Eagle Files and BOM
28 DIP v1
Here
Here
Here
Here
Here
28 DIP v3
Here Here Here
Here Here
28 DIP v4
Here Here Here
Here Here
28 DIP v5
Here Here Here
Here Here
28 SOIC v3
Here Here Here
Here
Here
28 SOIC v4
Here Here Here Here
Here
44 TQFP v1
Here Here Here N.A.
Here
44 QFN v1
Here Here Here N.A.
Here


Extra Pictures:
Files:
    Firmware Versions (Source code and project files - browsable):
    Bootloader:
    Demo PC Applications:
    INF Files (i.e. 'driver' files for installing UBW under Windows):
Documentation:
Important Links:

Questions? E-mail me at my e-mail address

Creative Commons License
UBW USB Bit Whacker by Brian Schmalz is licensed under a Creative Commons Attribution 3.0 United States License.
Based on a work at www.schmalzhaus.com/UBW.
Permissions beyond the scope of this license may be available at www.schmalzhaus.com/UBW.