SERIN/SEROUT flowcontrol?
So I am still working on the problem of communicating between two micros. I dumped the ooPic for now just to see if I could get two Basic Stamps to communicate.
I am still having a problem with flow control it appears tho.
The code I am using to test was taken from the BS manual..
Here is the code for the BS2PX thats sending the SEROUT
And here is the code for the BS2SX thats recieving with SERIN
It will only send one character, If I keep pressing run in Stamp Editor 2.2.5 the debug prints out the next character, then the next, and so on.. looping. Is just the inclusion of the pin for flow control all thats needed? or do I need to add something else?
I am still having a problem with flow control it appears tho.
The code I am using to test was taken from the BS manual..
Here is the code for the BS2PX thats sending the SEROUT
SO PIN 5 ' serial output FC PIN 7 ' flow control pin #SELECT $STAMP #CASE BS2PX T9600 CON 396 #ENDSELECT Inverted CON $4000 Baud CON T9600 + Inverted Main: DO SEROUT SO\FC, Baud, [noparse][[/noparse]"Hello!", CR] ' send the greeting LOOP ' repeat forever END
And here is the code for the BS2SX thats recieving with SERIN
SO PIN 2 ' serial output FC PIN 4 ' flow control pin #SELECT $STAMP #CASE BS2SX, BS2P T9600 CON 240 #ENDSELECT Inverted CON $4000 Baud CON T9600 + Inverted dataIn VAR Word(10) Main: SERIN SO\FC, Baud, [noparse][[/noparse]dataIn] ' send the greeting DEBUG dataIn END
It will only send one character, If I keep pressing run in Stamp Editor 2.2.5 the debug prints out the next character, then the next, and so on.. looping. Is just the inclusion of the pin for flow control all thats needed? or do I need to add something else?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
And if I have to do a loop, it would have to exit the loop at some time.. so maybe when it gets the carriage return "CR"?
how do I test for that? is it just
?
HTH
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
But it doesnt have a problem sending a string right? just recieving one?
I connected the pins to the recieve (pin 2) and the CTS (pin 7) on the serial cable going into my computer and ran hyper terminal..
the whole string comes across and teh carriage return.. so maybe the ooPic and the BS both have a hard time recieving strings.
Post Edited (Shredder) : 8/22/2006 8:00:33 PM GMT
Also, depending on what, specifically, you are trying to accomplish, there may be a solution which doesn't require more than 1 character to be transferred...especially if you are controlling both sides of the conversation.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...