Using Linux In-Kernel Virtual Communication Port (VCP) Driver
MCC
Linux-Compatible USB-based
I2C Bus Adapters
i2cStick (#MIIC-207)
iPort/USB (#MIIC-204)
i2cStick (#MIIC-207) 
i2cStick 2 (#MIIC-209) 
iPort/USB (#MIIC-204)
iPort/USB 2 (#MIIC-208)

Using the Linux in-kernel Virtual Communication Port (VCP) Driver

Linux includes an in-kernel Virtual Communication Port (VCP) driver that supports the USB interface IC used in MCC USB-based I2C Bus adapters (Silicon Labs #CP2102). Adding the adapter VendorID/ProductID (VID/PID) to the udev system enables VCP access to the adapter.

MCC USB-based I2C Bus adapters and VID/PID information:

i2cStick 2 (#MIIC-209) VID/PID (0E34/0209)
iPort/USB 2 (#MIIC-208) VID/PID (0E34/0208)
i2cStick (#MIIC-207) VID/PID (0E34/0207)
iPort/USB (#MIIC-204) VID/PID (0E34/0204)

Below is information regarding using the Linux built-in Silicon Labs CP2102 driver. The listing below shows where the udev rule needs to be modified. We do not run Linux in-house, but a number of our customers have successfully used the in-kernel driver using kernel v2.6. Specific distribution information is not available at this time.

The Linux support community on the web can provide lots of help udev rule development. Here are some examples:

Manage-Linux-Hardware-with-udev

Writting_udev_Rules

Silicon Labs also has their own Linux CP210x driver, but taking that route is out of our current field of knowledge.


If you want to use the Linux in-kernel driver (assuming it is installed) to control our Linux-Compatible USB-based I2C Bus adapters, the easiest method is to add a udev rule to the system, which defines the VID and PID.  The rule file should be stored in:

/etc/udev/rules.d

This added udev rule will allow a system with the CP210x driver installed to recognize the device VID/PID and access the device via a standard ComPort interface.  Below is the text of the file in its entirety.

Here are a few notes on the udev rule:

1. The VID in the example below 0E34 (hexadecimal) and the PID 0207 (hexadecimal) is for the MCC i2cStick.  You would want to modify these for your device. There are two places in the file where they show up.

2. The line "RUN+="/sbin/modprobe -b cp210x"" is what identifies the driver to use.  You may need two versions of a file like this in order to support kernel versions.  A while back (mid-2009 and earlier), the kernel driver was named "cp2101".  But it was renamed to "cp210x" more recently as it supports cp2101, cp2102 and cp2103 devices.  For older kernels, you will want to provide a file that says "cp2101" instead of "cp210x".

3. The optional area at the bottom of the file where it defines "Name of the Interface" and "interfaceSymLink", the SYMLINK portion of the udev file essentially creates a symbolic link in the /dev directory to the appropriate device the driver created.  So instead of connecting to /dev/ttyUSB0, you would connect to /dev/i2cStick (or any name given).  This ensures device names stay the same through reboots, which makes scripting much easier. You can modify both of these items as you see fit.

ACTION=="add", SUBSYSTEM=="usb", ENV{DEVTYPE}=="usb_interface", \
        ATTRS{idVendor}=="0E34", ATTRS{idProduct}=="0207", \
        DRIVER=="", \
        RUN+="/sbin/modprobe -b cp210x"

# add the VID and PID to the list of devices supported by cp210x ACTION=="add", SUBSYSTEM=="drivers", \
        ENV{DEVPATH}=="/bus/usb-serial/drivers/cp210x", \
        ATTR{new_id}="0E34 0207"

# optionally create a convenience symlink for the console device ACTION=="add", KERNEL=="ttyUSB*", \
        ATTRS{interface}=="i2cStick", \
        ATTRS{bInterfaceNumber}=="01", \
        SYMLINK+="interfaceSymLink"

Need more help? Send your questions to Support.


I2C is just a mouse click away