1. This forum section is a read-only archive which contains old newsgroup posts. If you wish to post a query, please do so in one of our main forum sections (here). This way you will get a faster, better response from the members on Motherboard Point.

i2c chip connected through USB port / Serial converter ttyUSB0 --Linux 2.6.17

Discussion in 'Embedded' started by Antoine, Nov 7, 2006.

  1. Antoine

    Antoine Guest

    I am trying to communicate with an i2c board that is connected to my PC
    through USB. The serial converter works and the PC detects the device
    /dev/ttyUSB0.
    Is there a driver to communicate through the serial port to the i2c
    chip?

    Thanks, Antoine
     
    Antoine, Nov 7, 2006
    #1
    1. Advertisements

  2. You can not connect an i2c device directly to a USB or RS232 (is that
    what you mean by seriel converter), even though all those have some kind
    of serial interface.

    You need either a USB-to-i2c device, or as USB-to-RS232, connect to a
    RS232-to-i2c. All of these devices come with drivers, the i2c part
    should also come with testing software. There are several on the market,
    just google for those.

    It is also fairly easy to write your own RS232-to-i2c converter, but
    knowledge in circuit design, i2c protocol, and a good microcontroller
    knowledge (AVR or PIC, or others) are needed.

    Matthias
     
    Matthias Melcher, Nov 8, 2006
    #2
    1. Advertisements

  3. Antoine

    Antoine Guest

    Agreed. I actually bought a physical interface that plugs into the USB
    port (USB-to-i2c).
    When I plug it into the PC, it gets detected and /dev/ttyUSB0 shows up.

    My question is: Is there code already done to interface with the
    /dev/ttyUSB0 to generate i2c commands?

    Thanks, Antoine
     
    Antoine, Nov 8, 2006
    #3
  4. Could you explain your set-up a little more?
    I understand that you run Linux on a PC and you have a USB device connected
    to it.
    Is it some kind of FTDI chip? For those, at least on Windows, there are in
    fact so called virtual com drivers which emulate a serial port over USB.
    However, these are intended to built RS232-to-USB converters. If I
    understand your question correctly you want to access an I2C device from
    your PC by means of an RS232 communication?
    Please keep in mind that I2C is *not* an asynchronous protocol and there are
    some differences thus, you will always need some protocol conversion logic -
    master/slave behaviour etc.

    I think it would be much easyer for you to use the API that came with your
    USB converter to write some basic I2C functions: Read, Write and
    ReadAfterRestart (combined transfer).
    /Roland
     
    Roland Zitzke, Nov 8, 2006
    #4
  5. Antoine

    Antoine Guest

    Thanks for your response.
    I have a USB-I2c device connected to my PC.
    Am using Linux, and yes I actually see the USB port as if it were a
    serial port (/dev/ttyUSB0).
    I am actually trying to write code to interface with /dev/ttyUSB0 to
    communicate to the I2c device.
    I will try to do this.
     
    Antoine, Nov 8, 2006
    #5
  6. If so, it's obviously a good deal more than just a physical interface.
    It takes a certain level of built-in "intelligence" to tell your
    computer that this USB device can be treated like a serial port.
    If none came with that device you bought, the answer quite probably is "no".
     
    =?ISO-8859-1?Q?Hans-Bernhard_Br=F6ker?=, Nov 8, 2006
    #6
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.