Shop OBEX P1 Docs P2 Docs Learn Events
Communication theoretical calculations!!! — Parallax Forums

Communication theoretical calculations!!!

James LongJames Long Posts: 1,181
edited 2009-12-18 08:07 in General Discussion
Ok,

Say I put 4 PCF8575's on an I2C bus, and run the bus with Mike Greens uber fast I2C object stripped out of some of his other projects.

How fast could the outputs change?

For instance. Say I have to communicate with every device on the bus with a round robin type of service. I set an output on one chip, how long would it be before I could turn that output off.

Each PCF8575 takes 3 bytes of info to set the outputs. They only run in fast mode (and slower) 400Khz.

If I were to stream serial data to those, how fast could the serial data come in? Where is my limit.

I have been trying to figure this out.....but I confuse myself.

A limitation would be nice, but some practical calculation would help just as much. (Give a man a fish, teach a man to fish..........you get the idea).

James L

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
James L
Partner/Designer
Lil Brother SMT Assembly Services

Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!

Comments

  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2009-12-18 02:56
    Each port access takes 24 bits + ack + start/stop so work that out to roughly around 32 clocks to allow for delays which is 80us at 400kHz I think. Four devices give you a 320us update rate or 3125Hz. Streaming serial data in at around 10 bits/character (1ST,8D,1SP) would mean 10 serial input bits per 32bits of port access which results in 1.25Mbaud data rate.
    I think that's right.

    P.S scrub that input rate, I think I messed up but you need a character (10 bits) every 80us which is 8us/bit which is 125kbaud.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    *Peter*

    Post Edited (Peter Jakacki) : 12/18/2009 3:02:53 AM GMT
  • James LongJames Long Posts: 1,181
    edited 2009-12-18 08:07
    Peter Jakacki said...
    Each port access takes 24 bits + ack + start/stop so work that out to roughly around 32 clocks to allow for delays which is 80us at 400kHz I think. Four devices give you a 320us update rate or 3125Hz. Streaming serial data in at around 10 bits/character (1ST,8D,1SP) would mean 10 serial input bits per 32bits of port access which results in 1.25Mbaud data rate.
    I think that's right.

    P.S scrub that input rate, I think I messed up but you need a character (10 bits) every 80us which is 8us/bit which is 125kbaud.

    Peter,

    I'm not sure we are communicating the same direction, or my calculations are totally bogus.

    This is how I look at this:

    The I2C chips can run up to 400K (400000) b/s.
    If we have 4 chips on a bus that limits the communication to each chip to a calculated number of 100K (25% of the bandwidth).

    Now since each chip takes roughly 32 bits per communication, that cuts the bandwidth to 3125 events per second.

    Ah....I see....we are on the same wave length. The serial side of the calculation is what threw me off.

    Ok....let's take this into a new direction, since you are good at doing this.

    Say I have a I2C bus with 8 chips like above.

    Can I realistically output Midi to those (each being a note in the midi file)? Do I have enough bandwidth on the I2C bus?

    The midi format is one thing that is confusing the situation. i can not figure out the length of a note on/note off event.

    James L

    didn't erase the first part of the post.......just to see we are on the same page.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    James L
    Partner/Designer
    Lil Brother SMT Assembly Services

    Are you addicted to technology or Micro-controllers..... then checkout the forums at Savage Circuits. Learn to build your own Gizmos!
Sign In or Register to comment.