No announcement yet.

Simple i2c software / hardware

  • Filter
  • Time
  • Show
Clear All
new posts

  • Simple i2c software / hardware

    Can any body point me in the direction of an easy to use i2c programming system and interface hardware?

    I'm trying to design a hardware fader for my stereo soundcard. By splitting the stereo signal into front & rear, and then passing each channel through a variable resistor I hope to be able to control the f&r volume separately.

    This would be dead easy with a couple of manual potentiometers, but I'd like to be able to do it from the touchscreen.

    From searching the web I've come across a range of digital potentiometers that can be set and controlled over the i2c protocol, and I've even seen cheap PC hardware.

    However it's the software side of things that I can't get my head around. My programming skill are rudimentary at best (I can just about get my head around simple VBA).

    What I was hoping to find is a simple package of i2c hardware and software, where I could call a DLL from autoit, and send the string of data bits I want to the potentiometer - but every system I see is far more complex than this, and way beyond my capability.

    Does anybody know of i2c programming for dummies software?

  • #2
    The USB-I2C device you mentioned is already using a virtual COM port. So it is like accessing it with hyperterminal. Are you finding it difficult to use the COM port or understanding how I2C works?


    • #3
      I believe I understand the principles of i2c - but I'd be the first to admit there's a big difference between this and actually being able to implement it!

      I think I'm bumping right up against my skill level here - I don't have the programming or computer skills to be able to communicate directly through the COM port.

      I guess what I was hoping for is a way I could type something like :

      SEND_I2C (001010101101010110)

      and that would do the job.

      I have no doubt that with time and effort I could work out what I need to, but I might instead go back to the drawing board and find a less elegant way to achieve what I want.



      • #4
        I did a quick search using google and there are several examples of communicating through the COM port using Visual Basic. You might try that route to get some example code you can use. If you can succeed in sending and receiving characters via the COM port from Visual Basic, then you can probably make your project work.

        Try to find some example code, short the TX/RX pins of your serial port together, turn off hardware flow control, and write an application in VB that sends data out and prints what it receives. From there you can remove the short and add the I2C module and try to send the data patterns required to make it talk I2C.

        You may end up with some routines like this:

        i2c_write(address, data)

        I don't think Visual Basic supports binary representation of numbers, but I'm not a visual basic expert. You may end up calling it with decimal or hex equivalents of the address and data to write to your I2C device.

        The protocol of the USB-I2C product you mentioned is fairly straightforward. If you get past the COM port test, then you might order one and give it a try. Looks to be reasonably priced.