Shop OBEX P1 Docs P2 Docs Learn Events
BS2 Execution Speed — Parallax Forums

BS2 Execution Speed

Donald BartleyDonald Bartley Posts: 19
edited 2005-10-26 19:16 in BASIC Stamp
Does anybody know how fast a BS2 executes code?

For example,·the BS2 sends serial data to a computer using the SEROUT command.· The·computer will respond with data back to the BS2 as soon as it receives the data from the BS2.· How long does the computer program have to wait to send data?· What is the time between when the BS2 has finished the SEROUT command and has loaded and is executing the SERIN command and can start receiving data?

Thanks! smile.gif

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2005-10-25 22:54
    Tracy Allen (www.emesystems.com) has lot of emperical information on BS2 module program execution speed, that will probably help. That said, when I create little helper modules (i.e., SX chips, PC programs) that are going to work with a BS2, I usually force the "helper" to wait 5 milliseconds before attempting to talk back to the Stamp. This is WAY more time than needed if SERIN immediately follows SEROUT, so it gives me the opportunity to have the Stamp do a little work before it gets another message from the "helper."

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
  • dandreaedandreae Posts: 1,375
    edited 2005-10-25 22:54
    This measurement of time is going to depend on the length of the SEROUT command.· If you want an exact measurement of time you will need to use an oscilloscope for accuracy.

    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Tech Support
    dandreae@parallax.com
    Http://www.parallax.com

    ·
  • MacGeek117MacGeek117 Posts: 747
    edited 2005-10-25 23:17
    The plain BS2 does ~4,000 instructions per second.
    RoboGeek

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There are 10 kinds of people in the world,

    those that know binary and those that don't.
    Formerly bugg.
    www.goldmine-elec.com
    www.parallax.com
    www.expresspcb.com
    www.startrek.com
    ·
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-10-26 19:16
    For this to work, the BS2 completes its earlier SEROUT, then must start the code for the SERIN. It will 'pend' in the SERIN (wait for data, basically). Worst case would be about 300 uSec to read and start execution of the SERIN.

    So, whatever device is recieving the SEROUT should wait around 300 to 500 uSec (or more, whatever is convenient) before sending data back to the BS2.
Sign In or Register to comment.