BS2p SERIN setup time?
Jay-
I've not timed the SERIN setup, but it's safe to assume it's well
below one millisecond.
Since you've got the 'p' model, you might be better off letting
the Stamp POLL for the data-imminent signal on I/O 0, then trigger
the SERIN processing based on the POLL results.
If you use the approach in your initial msg, be careful that the
[noparse][[/noparse] bla, bla, bla ] sequence doesn't take too long, or you may miss the
signal on I/O 0. Actually, the POLL logic may miss the signal, too,
if the signal is too short in duration, since POLL only checks its
I/O pin briefly between each statement in your program rather than
continuously.
Regards,
Steve
On 6 Jun 01 at 17:53, Jay Hanson wrote:
> How long does the basic interpreter/BS2p require to set up for the
> SERIN instruction?
>
> I am getting a signal on another pin about 40ms before the serial
> data begins coming from the GPS. Should 40ms be enough time to set
> up to read the data?
I've not timed the SERIN setup, but it's safe to assume it's well
below one millisecond.
Since you've got the 'p' model, you might be better off letting
the Stamp POLL for the data-imminent signal on I/O 0, then trigger
the SERIN processing based on the POLL results.
If you use the approach in your initial msg, be careful that the
[noparse][[/noparse] bla, bla, bla ] sequence doesn't take too long, or you may miss the
signal on I/O 0. Actually, the POLL logic may miss the signal, too,
if the signal is too short in duration, since POLL only checks its
I/O pin briefly between each statement in your program rather than
continuously.
Regards,
Steve
On 6 Jun 01 at 17:53, Jay Hanson wrote:
> How long does the basic interpreter/BS2p require to set up for the
> SERIN instruction?
>
> I am getting a signal on another pin about 40ms before the serial
> data begins coming from the GPS. Should 40ms be enough time to set
> up to read the data?
Comments
instruction?
I am getting a signal on another pin about 40ms before the serial data
begins coming from the GPS. Should 40ms be enough time to set up to read
the data?
IF (IN0 = 1) THEN readGPS
[noparse][[/noparse] bla bla bla ]
readGPS:
SERIN 1,baudMode,100,timeOutOnRead,[noparse][[/noparse]SPSTR cr]
Jay
> I looked at the POLLRUN but rejected it because it doesn't seem to
> save return information like a either a traditional program call or
> hardware interrupt would. Is that correct?
>
> If the BS2p basic would save return information (e.g., "PUSH" it on
> a stack, i.e., a location counter) so the called program could
> return to where it came from (e.g., "POP" the next location off the
> stack), then the POLLRUN would be much more useful.
I wish I could argue with any/all of the above, but you've nicely
summed up the challenges offered by the POLL and RUN
implementations.
You may have read the recent thread on a call and return strategy.
If not, it's in the archives.
Here's a not-fully-developed but probably-doable broad concept:
Modify the call and return logic to create a re-start scheme so that
the Stamp would always have a defined, workable state to resume from
following an asynchronous POLL event. Something like: if I'm dragged
away, resume at X. At some later point, the code would update the
re-start location to Y, and so on. The POLLRUN logic would point the
Stamp back to the designated resume location.
Regards,
Steve
>the Stamp POLL for the data-imminent signal on I/O 0, then trigger
>the SERIN processing based on the POLL results.
I looked at the POLLRUN but rejected it because it doesn't seem to save
return information like a either a traditional program call or hardware
interrupt would. Is that correct?
If the BS2p basic would save return information (e.g., "PUSH" it on a stack,
i.e., a location counter) so the called program could return to where it
came from (e.g., "POP" the next location off the stack), then the POLLRUN
would be much more useful.
Jay
The setup time for SERIN on the BS2 is about 0.5 to 1 millisecond, so
in your situation there is plenty of time. On the BS2p, the setup
time will be better than 2.5 times faster. The setup time depends on
exactly the form of the SERIN command. If you want more info, look at
this URL:
http://www.emesystems.com/BS2rs232.htm#sertime
-- regards,
Tracy Allen
electronically monitored ecosystems
mailto:tracy@e...
http://www.emesystems.com
>How long does the basic interpreter/BS2p require to set up for the SERIN
>instruction?
>
>I am getting a signal on another pin about 40ms before the serial data
>begins coming from the GPS. Should 40ms be enough time to set up to read
>the data?
>
>
>
> IF (IN0 = 1) THEN readGPS
>[noparse][[/noparse] bla bla bla ]
>readGPS:
> SERIN 1,baudMode,100,timeOutOnRead,[noparse][[/noparse]SPSTR cr]
>
>
>
>Jay