Christopher J. MacLellan
Carnegie Mellon University
I recently purchased a UBW (premade) and a UBW PTH kit (both 18f2553) from the Sparkfun website for a project that I am doing at my work. For this project I need to be able to read a thermistor (ADC), communicate with a Pololu Qik 2s9v1 motor controller (UART), and interface with an home brewed LED controller card which is controlled through a Digital POT with an SPI interface (SPI). When looking at the description from the sparkfun website for the UBW I believed it to be exactly what I was looking for:
**Particularly note the USB to UART converter board!
While the board from Sparkfun did include the 12bit A/D conversion, it lacked in both UART and SPI communication which I thought it included when I purchased the device. I later found out that while the PIC18f2553 had the hardware to perform hardware USART (UART... essentially the same thing... since I wanted asynchronous and didn't care about synchronous) and SPI none of this functionality was realized in the stock 1.4.5 firmware on the UBW project site , much less the 1.4.3 firmware that came on the Sparkfun device. Since the creator of the UBW project hasn't released the 1.5 firmware, which will supposedly include these capabilities, I decided to learn the ropes on pic programming and add it myself.
About 48 hours later I've finally got the hardware USART functionality working exactly as I wanted it.
Brian Schmalz the creator of the UBW project (bless his heart this piece of hardware was exactly what I needed for work!) outlined the specs for the CX, TX, and RX commands. I've essentially filled them out with minor changes for my application (bytes are typed in and displayed in decimal form).
In my firmware you can issue:
Additionally I added Software SPI (not hardware because the pins conflicted with the USART and SPI is easier to time in software because you have a dedicated clock line). I didn't add the configure command for SPI as I just run Mode 0,0.
Just issue "SS,
So if someone is interested in utilizing the functionality that I spent a couple days figuring out and programing and wants to just be able to install a firmware that has this functionality please feel free to download my source / firmware files.
Let me know if you need help or have questions about the functionality.
UBW FW D 1.4.5 Modified HEX (hex file)
UBW FW D 1.4.5 Modified (source files)
p.s. For the USART the TX/RX pins are the ones labeled as such on the Sparkfun boards. For the Software SPI, CS pin = RB2, Data In pin = RB3, Data Out pin = RB7, and SCK pin = RB6. *NOTE: I haven't extensively tested the SPI at this time but I will over the next week as I use it for work. I have tested the USART and have been able to communicate with the Pololu motor controller as well as with myself (loop back line connecting tx <-> rx).