en:i2c_avr_usb
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | en:i2c_avr_usb [Unknown date] (current) – external edit (Unknown date) 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== Converter from I²C to USB with AVR microcontroler (known as i2c-tiny-usb) ====== | ||
+ | The subject of this construction is solve frequent problem of connection of I2C or SMBus device on sensor to the computer system. Classical solution of this situation is connecting the I2C device to a microcontroler and then to higher computer system. | ||
+ | |||
+ | ===== Design of the intstrument ===== | ||
+ | |||
+ | ==== Interconnection ==== | ||
+ | |||
+ | The principial connection of the instrument follows: | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | In real implementation is slightly different and consist several MLAB modules. | ||
+ | |||
+ | {{ : | ||
+ | |||
+ | ==== Firmware ==== | ||
+ | |||
+ | Firmware is acessible in [[http:// | ||
+ | |||
+ | ===== Instrument function ===== | ||
+ | |||
+ | After connection to the computer we should see a new device on USB. | ||
+ | |||
+ | $ sudo lsusb -v -d 0403:c631 | ||
+ | | ||
+ | Bus 003 Device 018: ID 0403:c631 Future Technology Devices International, | ||
+ | Device Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | bcdUSB | ||
+ | bDeviceClass | ||
+ | bDeviceSubClass | ||
+ | bDeviceProtocol | ||
+ | bMaxPacketSize0 | ||
+ | idVendor | ||
+ | idProduct | ||
+ | bcdDevice | ||
+ | iManufacturer | ||
+ | iProduct | ||
+ | iSerial | ||
+ | bNumConfigurations | ||
+ | Configuration Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | wTotalLength | ||
+ | bNumInterfaces | ||
+ | bConfigurationValue | ||
+ | iConfiguration | ||
+ | bmAttributes | ||
+ | (Bus Powered) | ||
+ | MaxPower | ||
+ | Interface Descriptor: | ||
+ | bLength | ||
+ | bDescriptorType | ||
+ | bInterfaceNumber | ||
+ | bAlternateSetting | ||
+ | bNumEndpoints | ||
+ | bInterfaceClass | ||
+ | bInterfaceSubClass | ||
+ | bInterfaceProtocol | ||
+ | iInterface | ||
+ | Device Status: | ||
+ | (Bus Powered) | ||
+ | |||
+ | Toto zařízení je pak automaticity enumerováno a rozpoznáno jako I2C rozhraní. | ||
+ | |||
+ | ==== Enumerace na USB ==== | ||
+ | |||
+ | [38601.270471] usb 3-3.1: new low-speed USB device number 18 using xhci_hcd | ||
+ | [38601.292607] usb 3-3.1: New USB device found, idVendor=0403, | ||
+ | [38601.292613] usb 3-3.1: New USB device strings: Mfr=1, Product=2, SerialNumber=0 | ||
+ | [38601.292616] usb 3-3.1: Product: i2c-tiny-usb | ||
+ | [38601.292618] usb 3-3.1: Manufacturer: | ||
+ | [38601.312318] i2c-tiny-usb 3-3.1:1.0: version 1.05 found at bus 003 address 018 | ||
+ | [38601.332450] i2c i2c-8: connected i2c-tiny-usb device | ||
+ | [38601.332473] usbcore: registered new interface driver i2c-tiny-usb | ||
+ | |||
+ | Then we usually need a load of the i2c-dev kernel module to see a new I2C interface. | ||
+ | |||
+ | $ sudo modprobe i2c-dev | ||
+ | |||
+ | Then we should see all I2C and SMBus interfaces in our computer. | ||
+ | |||
+ | $ sudo i2cdetect -l | ||
+ | i2c-0 i2c | ||
+ | i2c-1 i2c | ||
+ | i2c-2 i2c | ||
+ | i2c-3 i2c | ||
+ | i2c-4 i2c | ||
+ | i2c-5 i2c | ||
+ | i2c-6 i2c | ||
+ | i2c-7 i2c | ||
+ | i2c-8 i2c | ||
+ | |||
+ | |||
+ | ===== Související stránky ===== | ||
+ | |||
+ | * [[en: | ||
+ | * [[en: | ||
+ | * [[en: | ||
+ | |||
+ | |||
+ | |||
+ | ==== References ==== | ||
+ | |||
+ | * [[http:// |
en/i2c_avr_usb.txt · Last modified: 2014/12/12 23:44 (external edit)