PROPOSED Documentation for Firmware D, version 1.5.x for UBW Boards
Back to main UBW page
NOTE: FW D 1.5.x is not out yet - no HEX file or source is available yet
FW D 1.5.x has been delayed due to other projects - final release date is currently planned for spring '08

Firmware version D is a more advanced (and more complicated) firmware version than Firmware C. Whereas C just allows you to write out 8 bits at a time to Port B, Firmware D allows you to use every one of the 19 I/O pins on the UBW Board as an input or an output, and to read the state of every one of those pins. In order to do this, it has an actual command structure that must be followed when communicating with it. (Note that there are 3 I/O lines on PortC of the assembled SparkFun version of the UBW board that are difficult to access. The UBW kit from SparkFun has a header for these three I/O lines - they normally control the two LEDs and read the PRG switch.)

28 vs 40 pin UBW designs:
So far, there are two basic groups of UBW boards in existance -
This version of Firmware D contains code to run on both types of UBW boards. The same project files, the same HEX file. When the program runs, it queries the PIC to see what type of processor it is runnign on, and then modifies its behavior accordingly. Any parameters having to do with PortD or PortE are obviously not very usefull on the 28 pin designs. Use the "V" command and parse its output so that your PC application can know what type of UBW board it is talking to.

Version Notes:
    Notes for ALL commands:
    The "TP" Command (New for 1.5.0)     The "SL" Command (New for 1.5.0)     The "TO" Command (New for 1.5.0)     The "TI" Command (New for 1.5.0)     The "PW" Command (New for 1.5.0)     The "SC" Command (New for 1.5.0)     The "SO" Command (New for 1.5.0) The "EC" Command (New for 1.5.0) The "ES" Command  (New for 1.5.0) The "MR" Command (Updated for 1.5.0) [CODED,TESTED]    The "MW" Command (Updated for 1.5.0) [CODED,TESTED] The "CU" Command (Updated for 1.5.0)
<Value> meaning
0 or 1
0 = Turn off "OK" packets
1 = Turn on "OK" packets (default)
0 or 1
0 = Turn off echoing of all data sent to UBW
1 = Turn on echoing of all data sent to UBW (default)
1 to 1000
Length of delay in <XXX> units for
pulse in TP command (default 10)

    The "C" Command:
    The "O" Command:
    The "I" Command
    The "V" Command
    The "R" Command
   The "T" Command
   The "A" Command
     The "PD" Command    The "PI" Command
   The "PO" Command   The "RC" Command     Binary Output Commands
The "BC", "BO" and "BS" commands all work together to allow for high speed parallel output to a hardware device like an LCD panel or other latched 8-bit parallel interface. The basic idea is to take a byte, write it out to PortB, set a strobe bit on PortA, wait a bit, then clear the strobe bit on PortA, then wait for a busy bit to go high (or low) on PortA, then wait for the busy bit to go low (or high) on PortA and then repeat for as many bytes as there are to send out PortB. So PortB is used as the output to the parallel bus and two bits on PortA are used as a strobe bit (output) and a busy bit (input).

       The BC command sets up all of the parameters, and then the BO or BS commands stream the data out PortB. Before this scheme will be very successful, make sure to set the direction bits on PortB and PortA properly.

    The "BC" Command
    The "BO" Command     The "BS" Command
Errors Messages:

The error messages returned by version 1.4.0 and up are totally different from those in previous versions. One of the changes in 1.4.0 is that code within the UBW can now use printf() (and associated functions) to send bytes back to the PC. This makes complex error reporting much easier.
There are two (or more) scenarios that one might use a UBW:
  1. By typing commands into a terminal emulator on a computer, to 'test out' commands and how the system is working.
  2. By writing a computer program that will automatically generate commands to send to a UBW.
The long error messages are very useful for debugging the system, and especially when using the UBW by hand from a terminal emulator. The long messages are not as useful when running under scenario 2) above, as the PC application has a much harder time parsing the long error messages.

To help make the error messages useful in both scenarios, each error message starts out with an exclamation mark "!" and then is immediately followed by an integer error number, then a space, and then the long text of the error message with a <CR><LF> at the end. This means that if your PC application wants to parse the error message, it can look in the data coming back from the UBW for the exclamation mark "!" and then read in the error number and ignore everything else until the next <CR><LF>.

Error Message List:

Back to main UBW page
Questions? E-mail me at my e-mail address