Getting error data or delay when BS2p24 communiates with BS2
ttxno1
Posts: 5
Hi
I have two Basic Stamp 2 chips, one is BS2, another one is BS2p24. I try to connect both them, and convey three BYTE data from BS2p24 to BS2. When I use command “SENOUT” to output value in the BS2p24, and command “SENIN” to get value in the BS2, BS2 chip usually delays and gets error data from BS2p24. How can I fix this problem? Thanks.
·
Source Code In the BS2p24:
·
·
Source Code In the BS2:
I have two Basic Stamp 2 chips, one is BS2, another one is BS2p24. I try to connect both them, and convey three BYTE data from BS2p24 to BS2. When I use command “SENOUT” to output value in the BS2p24, and command “SENIN” to get value in the BS2, BS2 chip usually delays and gets error data from BS2p24. How can I fix this problem? Thanks.
·
Source Code In the BS2p24:
DO
· SEROUT· 1 , 240 , [noparse][[/noparse]A, B, C]
LOOP
· SEROUT· 1 , 240 , [noparse][[/noparse]A, B, C]
LOOP
·
·
Source Code In the BS2:
DO
Initial:
· ··········· SERIN 0, 84, 20, Initial, [noparse][[/noparse]A, B, C]
LOOP
Initial:
· ··········· SERIN 0, 84, 20, Initial, [noparse][[/noparse]A, B, C]
LOOP
Comments
For receiving
Initial:
SERIN 0,84,20,Initial,[noparse][[/noparse]WAIT("!"),A,B,C]
and for transmitting
SEROUT 1,240,[noparse][[/noparse]"!",A,B,C]
Jeff T.
This adds a small pacing delay so that the slower BS2 can keep up. Also the "!" character is a good idea. Can the BS2p send data at any time? Maybe the BS2 needs a longer timeout, more than 20 milliseconds.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Post Edited (Tracy Allen) : 11/13/2007 4:29:05 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support