Shop OBEX P1 Docs P2 Docs Learn Events
Serin and Serout commands — Parallax Forums

Serin and Serout commands

Tricky NekroTricky Nekro Posts: 218
edited 2005-08-13 23:05 in BASIC Stamp
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--

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-08-09 14:35
    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 WilliamsJon Williams Posts: 6,491
    edited 2005-08-09 14:36
    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 NekroTricky Nekro Posts: 218
    edited 2005-08-09 22:30
    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 WilliamsJon Williams Posts: 6,491
    edited 2005-08-09 22:31
    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 NekroTricky Nekro Posts: 218
    edited 2005-08-11 10:44
    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, [noparse]/noparse]"Battery Status", [color=blue]DEC2[/color] status, [color=purple]CR[/color
    PAUSE·1000
    LOOP

    BS2(R):
    Status VAR Word

    DO
    SERIN 1\0, 16780, [noparse][[/noparse]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--
  • RobbyRobby Posts: 5
    edited 2005-08-13 11:11
    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
  • allanlane5allanlane5 Posts: 3,815
    edited 2005-08-13 15:00
    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 NekroTricky Nekro Posts: 218
    edited 2005-08-13 23:05
    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--
Sign In or Register to comment.