Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp Speed (Instructions per sec) — Parallax Forums

Basic Stamp Speed (Instructions per sec)

david43085david43085 Posts: 8
edited 2009-01-31 16:54 in BASIC Stamp
1.· When does the speed of the the stamp become an issue?· I recognize that different chips have different speeds, but how can you tell if·its relevant?

2.· What is the purpose of the interrupt? The stamps does not have this?

Thanks,

David

Comments

  • MovieMakerMovieMaker Posts: 502
    edited 2009-01-29 03:36
    It can mess your code up big time. You have to do the math if the program is designed say for a BS2 and you put in a BS2px24. I know from experience.
  • SRLMSRLM Posts: 5,045
    edited 2009-01-29 03:36
    1. Speed is mostly an issue in serial communications and processing data. Most microcontroller peripherals are slow enough to work with the basic stamp, although some can go faster. Processing data (such as mathematical operations) can take a long time on a slower microcontroller. A faster chip will rarely hurt you, while a slower one is more likely.

    2. An interrupt is a some special code that is run when an external state dictates. An example would be typing at a keyboard. The basic stamp does not support interrupts, so you have to code in way that your program checks the inputs periodically.
  • logic caselogic case Posts: 1
    edited 2009-01-31 05:01
    No expert here but I will share my experience.

    SRLM is right. I recently needed to monitor a constantly changing input at low speed. Always looking for the next high pulse. Code then reacted by sending Serial comms to 2 seperate devices. I initially coded for a Bs2 because I was waiting on a Bs2p24. The stamp could sporadically miss input pulses if it was busy sending serial commands. One could play with this by using DEBUG and monitor multiple outputs on a PC through the editor. It doesn't take but a few debug statements to start slowing things down enough to make a difference on the Bs2. The Bs2p24 simply runs faster and although still susceptible to this it was better. I may in the future use a second stamp to handle the serial load.
  • vaclav_salvaclav_sal Posts: 451
    edited 2009-01-31 16:54
    A processing speed becomes an issue when you need·a "real time" processing code.
    I am currently bulding a WWVB radio signal decoder / atomic clock.
    In an essence I read one second wide pulses and basically have 200ms to process the·data (analyze and display it on LCD) before next pulse comes.
    If BS2 can process the data in 200ms I'll be happy and that is the real mesurement of the necessary speed of the BS2 processor.
    At·present I time the incoming pulses using INx in a loop and looking for level transition.

    If interrupt was avaiable in BS2 it would "monitor" the transisions and would be tied to the processing code.
    There would be no need for the code to stay in a loop using interrupts.

    Another example - Windows OS is operating on the same·principle - the main program·stays in an event monitoring loop and exits this loop when events(mouse click etc.) are detected. It is not an interrupt driven OS and therefore does not operate in real time mode.

    The best example of real time interrupt driven device is the old UART which monitors the serial input and gives an output - interrupt - to the associated processor when data is ready to be process.

    Cheers
    Vaclav




    ·
Sign In or Register to comment.