Shop OBEX P1 Docs P2 Docs Learn Events
excution speed — Parallax Forums

excution speed

nemesiswesnemesiswes Posts: 17
edited 2008-02-04 20:27 in BASIC Stamp
Hey·I need to know how fast can the bs2 or the one on the board of education excute it's programming.

I·need it to do it atleast about every 1-10 milliseconds, maybe faster , and if it cant then could like a pc with a intel pentium 4 3Ghz 1.5G of ram do it.


The program is only about 5-10 lines not sure yet and it loops so it keeps going.

The program is for a motor·I am building, i have the circuit diagram made but just wasnt sure if the stamp could do it fast enough because it has to read a sensor and then if the sensor is on or high then it turns the electromagnet to high and then when the sensor is off, it turns the EM off

Comments

  • PJAllenPJAllen Banned Posts: 5,065
    edited 2008-02-04 00:42
    Not all commands take the same amount of time to execute.
  • allanlane5allanlane5 Posts: 3,815
    edited 2008-02-04 00:56
    It's roughly 2000 instructions per second, for the slowest BS2. I think they go up to 10,000 instructions/second, for the fastest.

    That's about 500 uSec per instruction, or 2 instructions per millisecond. So, then it depends on how difficult (how many instructions) what you want to do is.
  • nemesiswesnemesiswes Posts: 17
    edited 2008-02-04 01:49
    well all i am going to be doing is check to ses if the rotor is in the right place useing the sensor and if it is then it will turn the EM on, if not·it stays off and loops untell it is and there is 2 EM's that need to be turned on at the same time
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2008-02-04 06:31
    nemesiswes -

    Since you haven't told us what kind of motor this is, my guess is that this is either a brushless DC motor or a DC stepper motor that you are trying to operate. If I am correct there are better methods to control either/both of them.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    There is no pleasure in having nothing to do;
    the fun is in having lots to do, and not doing it!
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2008-02-04 20:27
    Bear in mind that the rating of 19,000 instructions/sec is approximate. Some instructions inherently take longer to execute. Especially commands that intentionally stop the program, such as PAUSE.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.