An Open Source USB to I2C interface
*** NEW: Now available to buy in my RobotFUZZ webshop ***
Features of new (still all GPL'd) version on RobotFUZZ
- High speed I2C Communications at up to 333KHZ
- SPI capable
- Can be used as an AVR programmer via avdude
- Has more generic software examples
The hardware is virtually identical, but the software has changed to use the hardware TWI module, allowing for high speed I2C. There is also SPI support in the new firmware, as well as the ability to flash an AVR chip using Avrdude. Firmware and software is still released under the GPL, but is significantly different to the one below, based on Till Harbaums work. The new firmware is based on Dick Streeflands usbtiny SPI adapter, with I2C written in. The new RobotFUZZ site also has API interfaces for Microsoft Windows, Visual Studio.net 2005 (C++ and VB.net) and more generic software.
I will leave the page below for historical reasons, but all development will now focus primarily on the new improved firmware.
Here is a design for a simple USB to I2C interface. It is based on the terrific work on the I2C-tiny-USB by Till Harbaum. These modifications are designed to control the OpenServo servo motor controller, but will serve as a generic USB to I2C interface.
- Simple USB to I2C interface
- Cross platform core library and sample applications
- Complete application interface for OpenServo project
- Applications Based on open source libusb,QT and GPL license
- 6xGPIO lines including support for Serial IO and 1 A/D channel
- Selectable internal or external power
- Upgradeable firmware* SPI support and speed enhancements coming soon
*requires Atmel programmer and converter cable
Source code and schematics are available, and can be downloaded from OpenServo CVS Also available is a windows dll file that can be used to communicate with the OSIF and reflash an OpenServo.
ONLY DOWNLOAD IF YOU BUILD YOUR OWN OSIF FROM THIS PAGE If you build one from the RobotFuzz webshop then please download the driver from there.
The control application and the underlying library are designed to run on multiple platforms. The main application uses QT for its widget library, and is statically compiled into the win32 release. For *nix and Mac platforms grab the latest CVS and run qmake;make for the QT application and make -f Makefile.platform substituting in either win32 for Windows or linux-shared for all other platforms.
When you plug the OSIF I2C device into your USB port you will be prompted to install the drivers. You can download the driver from the link above. Once you have unzipped the file, point the driver installation to look in the directory you unzipped to \drivers\
Install the libusb package from your package manager. If you want to compile from source you will need libusb-dev too. Everything else will work out of the box. Linux users can insmod the kernel module supplied in the CVS tree to access via the faster /dev/i2c-x interface.
The design is extended to use an Atmega 8/168 and also provide 3 GPIO lines to allow serial communication and an A/D line. The Mega8/168 was chosen to allow for common chip usage across this and OpenServo platforms.
The TX and RX lines on the 3 pin GPIO also allow for a LED to be connected for status and debugging.
The firmware is being extended to allow SPI mode as well as hardware based I2C communication. Provided is a connector that allows for flashing of the OSIF, flashing an OpenServo board via SPI or I2C and generic I2C lines.
There are two jumper pins on the OSIF.
JP1 allows you to use an external power supply to power your target application when disconnected. When it is connected it uses the USB +5V signal to power the application. While the USB power may be able to control some devices, it is recommended that you use an external PSU. Do not connect and external supply and this jumper. Although there is a diode to protect from this, serious damage may occur.
JP2 is normally disconnected unless you are SPI flashing the OSIF board with new firmware.
R4 and R5 are the I2C pullup lines, and suitable resistors should be selected for your bus. 10K is the recommended for low device count.
3D views of the board.