Basic Stamp Speed (Instructions per sec)
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
2.· What is the purpose of the interrupt? The stamps does not have this?
Thanks,
David
Comments
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.
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.
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
·