Shop OBEX P1 Docs P2 Docs Learn Events
i2c object — Parallax Forums

i2c object

mynet43mynet43 Posts: 644
edited 2007-10-24 08:45 in Propeller 1
I'm looking for help with i2c to drive a TI Audio Codec on the same bus used for the EEPROM.

Mike Green's Basic I2C Driver in the Object Exchange refers to: "I2C Object Library by James Burrows".

I haven't been able to locate this in the Object Exchange.

Please point me to this if possible.

Thanks for your help.

Jim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-10-20 17:11
    Yes, I don't see James' I2C Library in the Object Exchange either. I don't know why it's not there.

    The driver you have (Basic I2C Driver) should be usable for interfacing to other I2C devices as well as the PCM3060.

    In your case, you'd use the Start / Write / Stop routines with the Write routine used for the device select code, the
    register number, and the data bytes to load into the registers. Have a look at the WritePage routine for an example
    of the use of these routines to write to an EEPROM ... which is similar except that an EEPROM has two address bytes
    instead of a register number and the device select code is different.

    Post Edited (Mike Green) : 10/20/2007 5:19:42 PM GMT
  • mynet43mynet43 Posts: 644
    edited 2007-10-20 17:24
    Thanks Mike, that's a big help. I'll give it a try. It'll probably work fine for what I need.

    If anyone comes across the I2C Object Library, I'd like to take a look at it too.

    Jim
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-20 18:39
    I have both 1.3 and 1.4 versions on my drive. Should I post them here? (is that kosher?)
  • mynet43mynet43 Posts: 644
    edited 2007-10-20 19:29
    I don't see why not, they were originally here. I'd sure like to see them.

    Do you know the difference between the versions?

    Thanks
  • Fred HawkinsFred Hawkins Posts: 997
    edited 2007-10-20 21:39
    Only this difference: the 1.4 was saved to my folder called 'code problems'. Which may mean that I didn't notice it was the last used folder, or ... like it says.
  • mynet43mynet43 Posts: 644
    edited 2007-10-20 22:47
    Thanks a lot Fred.

    I'll take a look at them to see if I can spot the differences.

    I sent Paul a PM about it missing from the Object Exchange, so maybe he can get it back in there and clear up the version differences.

    Thanks again,

    Jim
  • mynet43mynet43 Posts: 644
    edited 2007-10-20 23:05
    Hi again!

    I took a quick look at the code for i2cObject.spin.

    The code is significantly different between V1.3 and V1.4, although the revision history is identical in both modules.

    I would recommend sticking with the V1.4 version, as it probably contains important bug fixes.

    Jim
  • JavalinJavalin Posts: 892
    edited 2007-10-22 19:04
    All,

    Sorry about that - it was deleted while being updated.

    I'll try to get 1.3 back on the object exchange (its not letting me at present)

    Version 2 will be based on Mike Green's basic_i2c_driver.spin at the core.

    1.4 was "beta" as i wasn't 100% about the page read/write routines.

    J
  • mynet43mynet43 Posts: 644
    edited 2007-10-22 23:57
    Javelin,

    Paul sent me an email this morning saying he was looking for the code.

    So you might want to send it to him directly, then he can post it.

    Both versions are available a couple of posts up in this thread.

    By the way, thanks for clearing up the confusion regarding 1.3 vs 1.4.

    Jim
  • JavalinJavalin Posts: 892
    edited 2007-10-24 08:45
    All,

    Sorry about the delay.

    Version 1.3 is back on the OBEX.

    James
Sign In or Register to comment.