PDA

View Full Version : Serin and Serout commands



Tricky Nekro
08-09-2005, 08:46 PM
I've resently bought a second BS2 and I want to put it with work with my first one, using the serin-serout command and some shift-registors. A·pair of·74HC595 and 74HC165(you have helped me for this too, and I'm very thankful)·could be used for binary status like IR and bumper and the the serout-serin command can be used for swiching them (reading bumpers.... reading IR and so on...) But what about if I want to make a seach unit between base connection??? A needed number of wires could be connected automatically to the search unit by the base when a entering a magnetic, for exable, field.
The data trasmitted would be displayed by an serial LCD, and the could be about battery status at least!!!(By a NE555)

Now the thing, I want most, from you guys is documentation about these commands and of course any help is appriciated much.

Thankfully, Provas, Greece!!!

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--

Bruce Bates
08-09-2005, 09:35 PM
Provas -

It sounds to me like you need a copy of the Parallax PBASIC Stamp Manual, which can be downloaded for free from this location:
http://www.parallax.com/html_pages/downloads/basicstamps/documentation_basic_stamp.asp

My thoughts on locating a base unit are pretty simple. Presuming the robot will wander outside of just one room, or beyond just one small area, you will most likely need two technologies, one of which will be RF (wireless/radio frequency) since you will need to communicate around corners, or through walls, etc. Once you get in the same room, ultrasonics, I/R and other methods can be used to locate and align with the base unit.

Regards,

Bruce Bates

Jon Williams
08-09-2005, 09:36 PM
I'm not sure about what you're asking except to say that all PBASIC commands are documented in our Syntax Manual and online help file. That's always the best place to start, as most commands have helpful examples.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Tricky Nekro
08-10-2005, 05:30 AM
The base idea, is the simpliest...

The whole idea is to enable the communication between the base and the search unit once connected. It would be a 1-wire connection or whatever is possible and easy to make...The base could be used also as a recharge pad...but this doesn't matter. The idea is the connection, how to make and how to programm it to work.

Thankfully for your replies, Provas, Greece

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--

Jon Williams
08-10-2005, 05:31 AM
You can use SERIN and SEROUT in an open baud mode to do that -- the help file shows how.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax

Tricky Nekro
08-11-2005, 05:44 PM
I have a question about baudmode.

The baudmode of the receiving unit must be at least equal to the the baudmode of the transmiting unit?

Also,·how we store and use status Data (%....)

I settled an exable:

BS2(E):

DO
SEROUT·1\0, 16780, ["Battery Status", DEC2 status, CR]
PAUSE·1000
LOOP

BS2(R):
Status VAR Word

DO
SERIN 1\0, 16780, [Status]
DEBUG Status
PAUSE 1000
LOOP

Of course this sample isn't right but how can i make it work???

Respectfully, Provas

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--

Robby
08-13-2005, 06:11 PM
Sorry gyes but what is this serin serout?is a kind of command to connect the base and the search unit?

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
DONT REST UNTIL YOU BEAT THE BEST

allanlane5
08-13-2005, 10:00 PM
SERIN and SEROUT implement an RS-232 interface. RS-232 is an 'asynchronous' protocol -- which means the sender must have a particular baud rate (like 9600 baud) and the reciever must have exactly the SAME baud rate (like 9600 baud).

Basically, baud rate and bit rate are the same thing.

Since it's 'asynchronous', the reciever will 'clock itself', in effect. So you can send data using only a single signal wire and ground. This makes it very nice to connect one BS2 to another. And because the BS2 can use the same pin for input and output (at different times in the program) you can 'talk' and 'listen' on the same wire.

So, you connect a TX and RX signal wire (and ground) between the 'base' and the 'search' unit. Then you program the base to do 'SEROUT' on the TX line, and the 'search' to do a SERIN on the TX line.

Tricky Nekro
08-14-2005, 06:05 AM
Ecxactly, but the point is how to display that data and how to sent them???



p.s. the other pin is the flow control pin...

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
-Rule your Destiny-
--Be Good. Be Bad. Be Provas--