Shop OBEX P1 Docs P2 Docs Learn Events
Multiple SX chips on I2C bus — Parallax Forums

Multiple SX chips on I2C bus

relaychiprelaychip Posts: 2
edited 2007-08-27 01:52 in General Discussion
I am somewhat new to the world of microcontrollers but for one of the project that I am involved with, I need to use multiple SX48 chips on a single I2C bus with one chip being the master and others (2-4 more SX48 chips) in slave mode. I need to know if this is possible or if there is some limitation whereby only a single SX chip can be on a I2C bus.

Thanks

Comments

  • JonnyMacJonnyMac Posts: 9,216
    edited 2007-08-26 22:59
    Get Gunther's book: he shows how to have I2C Master and Slave VPs running.

    www.parallax.com/detail.asp?product_id=70002

    Post Edited (JonnyMac) : 8/26/2007 11:11:15 PM GMT
  • Guenther DaubachGuenther Daubach Posts: 1,321
    edited 2007-08-26 23:20
    relaychip,

    the SX controllers do not come with dedicated I²C hardware peripherals, like other controllers do. Interfacing an SX to the I²C bus is just (or simply) a matter of software, IOW, you are free to implement whatever you need. You may have one SX acting as master, and several SXes acting as slaves on one bus, but with the right software, you can also implement multi-master systems with correct handling of bus arbitrations, etc.

    As a matter of fact, my very first project with SX controllers was an I²C bus system for the control panels of an electronic organ. This included one "Super Master", i.e. a module to interface the I²C bus to MIDI plus several other modules, like one with 16 potentiometers, or one with 64 LEDs, 64 pushbuttons, and a quadrature encoder. This was a typical multi-master system, as each of the modules could send a message when a potentiometer position was changed, a pushbutton was pressed or released, or when the encoder was turned right or left. On the other hand, the "Super-Master" could send messages to change the states of the LEDs, or to request the current potentiometer settings of one of the potentiometer boards.

    Due to the fact that the I²C prototcol on an SX is handled by software, you are not limited to any standards - if necessary, you may even adapt the protocol to your specific needs.

    You can find sample I²C code at www.parallax.com/dl/appnt/sx/An29.pdf, www.parallax.com/dl/src/prod/sx/i2cs.zip, www.sxlist.com/techref/i2cs.htm, www.sxlist.com/techref/i2cs.htm, or in APP025.SRC contained in the ZIP of my book's sample code archive at www.parallax.com/dl/src/prod/sx/ProgSXEdPre.zip

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Greetings from Germany,

    Günther
  • relaychiprelaychip Posts: 2
    edited 2007-08-27 01:52
    Thanks for the replies. This helps a lot and I can now move forward confidently with my project!!
Sign In or Register to comment.