The i2c-tiny-usb project is an open source/open hardware project. The goal of i2c-tiny-usb is to provide a cheap generic i2c interface to be attached to the usb. It is meant as a replacement for those simple and cheap printer port to i2c adapters. A USB solution has several advantages incl. the built-in power supply and a more future proof interface. Furthermore no cpu intense bitbanging is required on the host side. This USB solution even requires less parts than some printer port solutions. While the i2c-tiny-usb was developed under and for Linux it also works under Windows and MacOS X. A windows demo driver and demo application is included to get you started immediately. More: The i2c-tiny-usb project is based on: The Linux USB project and the Linux i2c implementation The windows driver and test application are based on the libusb-win32 AVR-USB, a pure software implementation of USB for the AVR platform USBtiny, another software usb implementation for the AVR The USB interface of the i2c-tiny-usb interface is based on a pure software implementation and uses two pins of the AVR (PB0 and PB2). This software implementation supports low speed USB only which is signalled to the PC by resistor R1. The I2C interface is implemented using a bitbanging approach. The hardware supported twi interface of the attiny45 is bound to hardware pins at the chip that are required for USB operation and can thus not be used for I2C. The bitbanging I2C interface being used instead may not be fully I2C compatible and thus not every I2C client chip may function correctly at this bus. No incompatibilities have been reported so far. The i2c-tiny-usb provides a software adjustable i2c clock delay allowing to configure the i2c clock. The default delay is 10us. Due to additional delays in the i2c bitbanging code this results in a i2c clock of about 50kHz. For simplicity reasons all USB transfers are done via the control endpoint. Since the avr usb library does only support low speed devices it cannot use bulk transfers which are specified for high and full speed devices only. Low speed devices support so called interrupt transfers which are limited to a preset bandwidth while control transfers can use any free bandwidth (if there's any at all). The device therefore uses control transfers for all of its communication. This requires some additional limitation to prevent multiple driver software (e.g. the kernel driver and the libusb based test application) to access the device at the same time. Under Linux this can be achieved by selecting certain access request types. This kind of access control may not be possible under other operating systems. Power consumption The whole device is a so called bus powered device. This means that the complete device is powered directly from USB. Therefore the AVR and one or more I2C client chips are powered from the USB VBUS signal. The adapter itself draws less than 10mA and reports this to the host via its USB descriptors. The device is able to power I2C client chips as well. But since these chips vary in power consumption it is not possible to correctly include their demands into the device descriptors. It's your responsibility to keep an eye on the total power supply and especially to make sure that the entire device does not exceed the total USB limit of 500mA. It is planned for future firmware versions to make the reported power consumption software configurable so the value can easily be adopted to the real power demands of the entire device.
The i2c-tiny-usb project serves as an interface between I2C devices and USB hosts, utilizing an AVR microcontroller for its operation. The design employs a software-based USB implementation, which is executed through two designated pins on the AVR microcontroller (PB0 and PB2). This configuration specifically supports low-speed USB communication, which is indicated to the host computer via a resistor (R1). The I2C interface is realized through a bit-banging technique, as the dedicated TWI (Two-Wire Interface) pins on the ATtiny45 are reserved for USB functionality.
The bit-banging method, while effective, may not guarantee full compliance with I2C standards, potentially leading to compatibility issues with certain I2C devices. However, the project has yet to encounter significant incompatibility reports. A notable feature of the i2c-tiny-usb is its adjustable I2C clock delay, which allows users to configure the clock speed according to their needs. The default clock delay is set to 10 microseconds, resulting in an approximate I2C clock frequency of 50 kHz, taking into account the additional delays introduced by the bit-banging code.
All USB communications are conducted via control transfers, as the AVR USB library is limited to low-speed devices and does not support bulk transfers. This necessitates a careful management of access to the device to prevent conflicts between multiple driver applications, particularly on operating systems like Linux, where access control can be managed through specific request types.
As a bus-powered device, the i2c-tiny-usb draws power directly from the USB connection, supplying power to the AVR microcontroller and any connected I2C devices. The adapter itself consumes less than 10 mA and communicates this power requirement to the host through its USB descriptors. However, the power consumption of connected I2C devices can vary significantly, making it essential for users to monitor the total power draw to ensure compliance with the USB limit of 500 mA. Future firmware updates are anticipated to enhance the power reporting capabilities, allowing for a more accurate reflection of the device's power demands.The i2c-tiny-usb project is an open source/open hardware project. The goal of i2c-tiny-usb is to provide a cheap generic i2c interface to be attached to the usb. It is meant as a replacement for those simple and cheap printer port to i2c adapters. A USB solution has several advantages incl. the built-in power supply and a more future proof interface. Furthermore no cpu intense bitbanging is required on the host side. This USB solution even requires less parts than some printer port solutions. While the i2c-tiny-usb was developed under and for Linux it also works under Windows and MacOS X. A windows demo driver and demo application is included to get you started immediately. The i2c-tiny-usb project is based on:
The Linux USB project and the Linux i2c implementation
The windows driver and test application are based on the libusb-win32
AVR-USB, a pure software implementation of USB for the AVR platform
USBtiny, another software usb implementation for the AVR
The USB interface of the i2c-tiny-usb interface is based on a pure software implementation and uses two pins of the AVR (PB0 and PB2). This software implementation supports low speed USB only which is signalled to the PC by resistor R1.
The I2C interface is implemented using a bitbanging approach. The hardware supported twi interface of the attiny45 is bound to hardware pins at the chip that are required for USB operation and can thus not be used for I2C. The bitbanging I2C interface being used instead may not be fully I2C compatible and thus not every I2C client chip may function correctly at this bus.
No incompatibilities have been reported so far. The i2c-tiny-usb provides a software adjustable i2c clock delay allowing to configure the i2c clock. The default delay is 10us. Due to additional delays in the i2c bitbanging code this results in a i2c clock of about 50kHz. For simplicity reasons all USB transfers are done via the control endpoint. Since the avr usb library does only support low speed devices it cannot use bulk transfers which are specified for high and full speed devices only. Low speed devices support so called interrupt transfers which are limited to a preset bandwidth while control transfers can use any free bandwidth (if there's any at all).
The device therefore uses control transfers for all of its communication. This requires some additional limitation to prevent multiple driver software (e.g. the kernel driver and the libusb based test application) to access the device at the same time. Under Linux this can be achieved by selecting certain access request types. This kind of access control may not be possible under other operating systems. Power consumption
The whole device is a so called bus powered device. This means that the complete device is powered directly from USB. Therefore the AVR and one or more I2C client chips are powered from the USB VBUS signal. The adapter itself draws less than 10mA and reports this to the host via its USB descriptors. The device is able to power I2C client chips as well. But since these chips vary in power consumption it is not possible to correctly include their demands into the device descriptors. It's your responsibility to keep an eye on the total power supply and especially to make sure that the entire device does not exceed the total USB limit of 500mA.
It is planned for future firmware versions to make the reported power consumption software configurable so the value can easily be adopted to the real power demands of the entire device. 🔗 External reference
This device allows two computers to share a single USB printer or other USB devices, such as an external flash drive, memory card reader, or scanner. A rotary switch is used to select the PC that will use the...
When the SDA (Serial Data) and SDA' lines are at a logical '1', the circuit is inactive, preventing the optocouplers IC1 and IC2 from transmitting any information. However, once the SDA line transitions to '0', the LED in IC1...
This device enables two computers to share a single USB printer or other USB devices such as an external flash drive, memory card reader, or scanner. A rotary switch is used to select the PC that will connect to...
There are plans to achieve a sampling rate of 1 Gsps in the future using interleaved ADCs and staggered clocking; however, the initial iteration will only support 100 Msps, which is the maximum from a single ADC. The most...
The most popular LCD interface is the Hitachi 44780 based LCD controller chip which provides a fairly easy to work with interface and low power consumption. The major drawback of the interface is the perceived complexity of working with...
74hc573 is used to store data so that the previous content on SS is not vanish when we disable LE pin. T0 select the proper latch 74hc238, 3x8 decoder is used. And to convert BCD into decimal, 74ls48 converter...
We use cookies to enhance your experience, analyze traffic, and serve personalized ads.
By clicking "Accept", you agree to our use of cookies.
Learn more