Udebug - a USB debug board

I wanted a small USB debug board that had a couple of I/O pins, a serial port and a relay.

Since I've used the Cypress FX2 before, I decided to use it as the base of the design. The FX2 is a 8051 microcontroller with a high speed USB interface. When reset, the FX2 reads a USB Vendor and Product ID from an I2C EEPROM and presents itself with this ID on the USB bus. The USB host then downloads a firmware matching this Vendor and Product ID into RAM on the FX2 which then disconnects from the USB bus, starts running the newly downloaded firmware and presents itself as a different USB device with different a Vendor and Product ID.

To control the I/O pins and implement the serial port I'm using an Altera MAX II CPLD, an EPM240. As a bonus, the EPM240 has 9kbits of built in flash memory which can be used as an I2C EEPROM, so I won't need a separate chip for that.

The EPM240 has two I/O banks, so the idea is to use one bank to connect to the FX2, the serial port and the relay, and to use the other bank for all the I/O pins. The banks have separate VCCIO supplies, so the FX2 bnk will use 3.3V and the other bank can use some other I/O voltage such as 1.5V or 2.0V.

One thing to note is the magic resistors in series with I2C SCL and SDA. If you look at them on the board, it is a footprint for a 0603 resistor, but with a wire between the pads. Normally, I want SCL and SDA to be connected, but I'm a scrooge so I don't want to waste two 0 Ohm resistors. But if I mess up and manage to program a bad CPLD image which makes it pull SCL low, the FX2 chip will hang during boot because the I2C bus is stalled. So If I manage to do that (and of course I did), I have to cut the wires between the pad nad boot the board without the CPLD. This makes the FX2 use the default Cypress Vendor and Product ID, I then have to download the firmware and reprogram the CPLD to something that does not hang the I2C bus, and finally solder on a 0 Ohm resistor to make the I2C bus work again.

The Eagle CAD files for the board can be found in my subversion repository.

Results

I used Olimex to manufacture the PCB and then built the board by hand. Almost everything worked as designed, except that I had managed to flip the pins of the serial port, so I had to mount it upside down.

The firmware and CPLD image for the board is a part of my EZ-USB project.

Bugs and Enhancements

The board has a few bugs and things I'd like to improve if a build a new one.

Bugs

#13
Serial port is upside down

Enhancements

#14
Use normal LEDs instead of the RGB led
#15
Make it possible to use a EPM570