SchmalzHaus logoUBW32 FAQ
By: Brian Schmalz
Back to UBW32

What is J2 and what part mates with it?

J2 is an extra power connector. So is J1. You can use either to apply 7.6V to 15V DC to the UBW32 to power it. The mating connector is any of the JST connectors that SparkFun sells, like this one or this one. (There are lots of others.) Note that it can be VERY hard to remove these connectors the first couple times you insert them. Make sure to pry with a screwdriver around the edges rather than pull on the wires.

Can I program and debug the UBW32 with a PICKit2?

Yes and no. You can program your UBW32 with a PICKit2 by using the stand-alone PICKit 2 v2.61 application that you can find here. However, the PICKit2 can NOT be used under MPLAB as a programmer or debugger with the PIC32 family, including the UBW32. If you want a cheap way to do real debugging, use the PICKit3, which works quite well. I did almost all UBW32 software development by using the PICKit2 and the stand-alone application, so it does work.

So then how do you debug during development if you only use a PICKit2?

Well, once I got the bootloader running, I didn't need the PICKit2 anymore. I just used the bootloader to get code onto the UBW32. And once I got USB running, I re-directed printf() to the USB serial port, and so I could just use printf() debugging in my code. This works well, but has some limitations. For more serious debugging, I used spare I/O and a logic analzyer (which works very well for ISR timing.) And if things get REALY scary, I break out the PICKit3 from within MPLAB (and then rebuild without bootloader support) do step through code and examine variables.

How do I use a battery to supply power to the UBW32?

Well, the UBW32 is not very power efficient. The PIC32 itself can be very low power, but the UBW32 was not made with battery power in mind. Thus, you'll see a pretty large current draw just from the UBW32 itself. At 5V input (to the 5V net, or through USB) the UBW32 draws about 75mA. This is primarily because the 3.3V regulator wastes a lot of current as heat.

Anyway - you can power the UBW32 with a battery. The easiest way is to get a battery between 7.6V and 15V and connect it to eithe J1 or J2.

I just built one of Microchip's examples and programed it into the UBW32 with my PICKit2, but it doesn't work at ALL!!! Help!

It turns out that the Microchip example code has the config bit DEBUG set to ON. For whatever reason, when you use the PICKit2 to program the UBW32 with a HEX file that has this bit ON, your program won't run at all. There are two solutions:

  1. Leave the code alone, and use a PICKit3, ICD3 or RealIce from within MPLAB to program your UBW32. Then it will work
  2. Change it so that the line reads #pragma config DEBUG = OFF, recompile, program with PICKit2, and then it will work.

I am building my own firmware for UBW32, and I can program it using the HID Bootloader but after I reset the board, the bootloader always runs, never my firmware. What is wrong?

It my have to do with the linker script file called procdefs.ld. See the "UBW32 Linker File and HID Bootloader" section of this page.

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

Creative Commons License
UBW32 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/UBW32.
Permissions beyond the scope of this license may be available at www.schmalzhaus.com/UBW32.