Results 1 to 4 of 4

Thread: Simple i2c software / hardware

  1. #1
    Low Bitrate
    Join Date
    Nov 2004
    Location
    UK
    Posts
    102

    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.

    http://www.robot-electronics.co.uk/htm/usb_i2c_tech.htm

    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. #2
    Newbie
    Join Date
    May 2004
    Posts
    44
    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. #3
    Low Bitrate
    Join Date
    Nov 2004
    Location
    UK
    Posts
    102
    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.

    Ian

  4. #4
    Newbie
    Join Date
    Feb 2007
    Location
    Santa Cruz, California
    Posts
    26
    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)
    i2c_read(address)

    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.

    Mark

Similar Threads

  1. AutoTap used to develop custom software!
    By Dodger1417 in forum Engine Management, OBD-II, Engine Diagnostics, etc.
    Replies: 5
    Last Post: 09-25-2006, 11:51 AM
  2. Replies: 13
    Last Post: 09-11-2006, 03:25 PM
  3. How to write software to interface with hardware?
    By xLusi0n in forum Software & Software Development
    Replies: 6
    Last Post: 05-09-2005, 05:32 AM
  4. Replies: 31
    Last Post: 04-18-2005, 05:12 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •