Potential timing problem
Archiver
Posts: 46,084
Since Stamps don't use interrupts, what would be the results of the
following?
You are detecting the state of an input(high or low, doesn't matter)
using IF THEN or something similar, and the Stamp just happens to be
EXACTLY in the middle of a clock cycle when a transition occurs. Will
the Stamp call this a high or a low? Or will it become very confused
and stop working?
Dave
following?
You are detecting the state of an input(high or low, doesn't matter)
using IF THEN or something similar, and the Stamp just happens to be
EXACTLY in the middle of a clock cycle when a transition occurs. Will
the Stamp call this a high or a low? Or will it become very confused
and stop working?
Dave
Comments
the 1.4 volt point.
Thus, if your voltage is changing as the BS2
reads it, the BS2 will get a 'snapshot' of the
state -- if it is above 1.4 volts, the BS2
will say it is a 1. If below, it will say
it is a 0.
--- In basicstamps@yahoogroups.com, "dersonquilter2"
<dersonquilter2@y...> wrote:
> Since Stamps don't use interrupts, what would be the results of the
> following?
> You are detecting the state of an input(high or low, doesn't matter)
> using IF THEN or something similar, and the Stamp just happens to
be
> EXACTLY in the middle of a clock cycle when a transition occurs.
Will
> the Stamp call this a high or a low? Or will it become very
confused
> and stop working?
>
> Dave
<dersonquilter2@y...> wrote:
> Since Stamps don't use interrupts, what would be the results of the
> following?
> You are detecting the state of an input(high or low, doesn't matter)
> using IF THEN or something similar, and the Stamp just happens to
be
> EXACTLY in the middle of a clock cycle when a transition occurs.
Will
> the Stamp call this a high or a low? Or will it become very
confused
> and stop working?
>
> Dave
The difference here is between analogue and discrete signals.
a discrete signal is just ON or OFF, there is no middle or in-between
point.
When the program reaches said input, it looks at that input and
decides if it is high or low and then just keeps running with
whatever it saw.
The speed of a circuit is often a question, and if speed of response
is an issure, you control should be a minimum of 4 times faster than
the thing being controlled.
Dave