Shop OBEX P1 Docs P2 Docs Learn Events
I2C with the SX28 (SX/B not ASM) — Parallax Forums

I2C with the SX28 (SX/B not ASM)

crgwbrcrgwbr Posts: 614
edited 2006-11-02 21:19 in General Discussion
Hey Everyone,
I've been looking into using th PCF8574 in a project, orriganally I was going to use the BS2-40, but for several reasons, I decided to use the SX28 instied.· The BS2p the I2C syntax looks like this:

[font=TimesNewRoman,Bold size=2]I2COUT· Pin, [/font]SlaveID, Address {\LowAddress}, [noparse][[/noparse]OutputData]
[font=TimesNewRoman,Italic size=2]However, in SX/B it looks like there is no place to put the Slave ID or the Address.· How do you specify them.[/font]
Thanks,
crgwbr
[font=TimesNewRoman,Italic size=2]
[/font]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
NerdMaster
For
Life

Comments

  • BeanBean Posts: 8,129
    edited 2006-11-02 17:30
    In SX/B you need to send each byte seperately.

    I2CStart Pin
    I2CSend Pin, SlaveID
    I2CSend Pin, Address
    I2CSend Pin, LowAdress
    I2CSend Pin, OutputData
    I2CStop Pin

    See the example in the help file for the I2C commands.

    Bean.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Cheap used 4-digit LED display with driver IC·www.hc4led.com

    Low power SD Data Logger www.sddatalogger.com
    SX-Video Display Modules www.sxvm.com

    "People who are willing to trade their freedom for·security deserve neither and will lose both." Benjamin Franklin
    ·
  • crgwbrcrgwbr Posts: 614
    edited 2006-11-02 17:35
    Thanks Bean. I forgot about the 1 byte at a time rule in sx/b.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    NerdMaster
    For
    Life
  • JonnyMacJonnyMac Posts: 9,071
    edited 2006-11-02 21:19
    Do keep in mind that all of the SX/B I2C commands generate code to deal with I2C timing, so you can use up a bunch of code space if you have too many of these commands in your listing. What do, as with SERIN and SEROUT, is embed these commands into my own subroutines, that way they only get compiled once and I'm able to add features to my calls.
Sign In or Register to comment.