Shop OBEX P1 Docs P2 Docs Learn Events
SX/B I2C Command — Parallax Forums

SX/B I2C Command

RsadeikaRsadeika Posts: 3,837
edited 2006-05-03 17:04 in General Discussion
I have the I2C_UART demo board, which has an EEPROM and the SX28 on one I2C buss. The question is, using SX/B I2C commands, how can I access either the SX28 or the EEPROM. The board contains two SX28's which are hard-wired via I2C line, and the EEPROM, which is also hard_wired on the same line.

I would prefer to have both SX's·be running in SX/B. I saw a snippet for accessing an EEPROM, using SX/B, and the SX/B code uses A0 as the ID for the EEPROM, is this a given for all EEPROM's. And is their a way of giving the SX28 an ID that the I2C command will understand within SX/B code.

This does not pertain exclusively to the I2C_UART demo board, I can see using something like this on two seperate boards.

Thanks

Ray

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-03 13:51
    The I2C instructions in SX/B are very generic and can be used for anything. $A0 is indeed a generic ID for memory devices, but you should never count on that -- ALWAYS download and read the docs for the device in question. You'll find slightly different addressing schemes for various memories.

    I posted our Serial InkJet Module code here several months ago -- it contains I2C routines for download and pulling character maps from an onboard EEPROM.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • JavalinJavalin Posts: 892
    edited 2006-05-03 16:05
    Also,

    SX/B does not allow the SX to be a I2C slave!

    James
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-03 16:13
    Sorry, I should have been clear about that, James is right. What I meant to say is that you can do any (7-bit addressing) master operations with the SX/B I2C -- it just takes a bit of code. It's a good idea to encapsulate the SX/B I2C instructions in subroutines so that they only compile once.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • RsadeikaRsadeika Posts: 3,837
    edited 2006-05-03 16:22
    My post was a poor attempt at probing for some info as to what the next version of SX/B is going to contain. Their was some vague references to·this in an earlier thread somewhere in this forum, but I figured that by now something else could get disclosed.·I was·really trying to get it verified that SX/B will not have any slave capabilities in the next version, or any version in the NEAR future.

    I wanted to make sure of this point before I start developing slave capabilities in asm for one of the processors, I was hoping to avoid that, but ...

    Thanks

    Ray
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2006-05-03 17:04
    There are no changes to any of the I2C functionality, nor is it planned. If you want to create an I2C slave you need to hand code it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
Sign In or Register to comment.