Shop OBEX P1 Docs P2 Docs Learn Events
Is it possible to do I2C multi-master with propeller? — Parallax Forums

Is it possible to do I2C multi-master with propeller?

jazzedjazzed Posts: 11,803
edited 2013-07-26 15:40 in Propeller 1
I say it is impossible to do with another propeller and non-propeller device. Prove me wrong.

Comments

  • jmgjmg Posts: 15,173
    edited 2013-07-26 13:01
    ?? Do you mean multiple i2c masters in a Prop, or a single master that talks to multi slaves, or a master that can clock stretch and do wired or style CAN-like bus arbitration, so that simultaneous transmits are resolved (requires significant bus quiet times)
    With a small number of bus sharing masters, one trick that could help, is a width-modulation of start, so the Props can identify when a non-Prop (and even which other prop..) is in control of the start condition. Earliest arbitration is going to be easiest.
  • KeithEKeithE Posts: 957
    edited 2013-07-26 13:03
    Jazzed - do you know of anybody who has multimaster working reliably on any platform? I've heard plenty of horror stories. I know of a company which mandated multimaster for a certain cellphone interface, then backed down do to reliability problems. It would be elegant to have for sending/receiving bidirectional serial streams, and not having to do any polling. So if you know of a golden implementation where someone has really done stress testing to demonstrate the reliability it would be interesting.

    In case it's too tricky, can someone use a side channel for bus arbitration for your application? Or would you just choose another interface at that point?
  • jazzedjazzed Posts: 11,803
    edited 2013-07-26 13:10
    Propeller performing as one of N masters on the I2C bus according to the I2C specification. I2C Bus Spec pdf Page 7 "Multi-master"

    KiethE, the subject comes up every now and then :)
  • JonnyMacJonnyMac Posts: 9,107
    edited 2013-07-26 14:52
    I think Guether Daubach did multi-master I2C on the SX -- if that's the case then it should port to the Propeller without too much fuss. No?
  • jmgjmg Posts: 15,173
    edited 2013-07-26 15:21
    I'm sure it is do-able, the only question would be 'At what Speed' ?

    Because of the Async nature of the signaling, and you want to avoid lock-outs, you would code this much like a quadrature counter.

    ie
    Sample for edges on both SDA and SCL and run a state engine / jump table from the 8 possible change-seen answers. (plus dummy branches on the 8 possible no-change values).

    Start would always be visible, and would trump all other states.
    At a guess 100KHz should be attainable, 400KHz probably less likely.

    One nice detail with the Prop, is you could load up 8 instances of this, and have them chatter away as a stress test, and when that works, run two Props for 16 chatter points.
  • RforbesRforbes Posts: 281
    edited 2013-07-26 15:40
    jazzed- I've just starting learning the details of I2c and this post is very interesting to me. What do you see as the most difficult hurdle here? I see there is an Arbitration scheme that needs to be followed for multiple masters- is that where you see difficulties?
Sign In or Register to comment.