Shop OBEX P1 Docs P2 Docs Learn Events
Using SERIN and SEROUT to send/recieve on a transceiver — Parallax Forums

Using SERIN and SEROUT to send/recieve on a transceiver

unteerunteer Posts: 5
edited 2007-05-07 18:18 in Learn with BlocklyProp
Hey Folks,
Sorry, not code to post yet, but here is the general problem. I am building a radio communication library chip for a multi-agent robotic design. Sadly I am starting to realize PBASIC just might not have what it takes to get the job done, but I am still trying to understand the full extent of its capabilities before i write it off.
Here's the problem. I need to have a series of loops that listen on different pins for incoming data. I used headers in my transmission packets to denote packet type. Atfirst I was hoping to just use the WAIT modifier with my BS2's and then timeout if the wait was not met. But all my experiments and reading the manual have informed me that wait only timesout if it is getting no data whatsoever. In some cases my receiver will be picking up data but it needs to know to ignore it and move on.
The problem is made worse when I have certain needs for speed while maintaining data integrity. All of my experiments have led to the conclusion that the only way to get the proper data as fast as possible is by using flowcontrol and the wait modifier. This ensures the receiver does not need to start reading immediately upon the tranmission beginning, but can wait for a bit to pick up the proper data.
So my question is: do I have this all wrong. I am a student and I am used to having published papers to work with, but it seems I am the only person in the world trying to do this, but I know this cannot be true. If I cannot use WAIT, did I miss something about other methods that would ensure integrity and speed? I need the connection to timeout if there's nothing to listen to or else the entire system is shot.

Cheers!

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-05-07 03:42
    As far as I know, your observations are correct. The timeout applies to the reception of any characters and is unrelated to the WAIT modifier. The WAIT modifier is really intended to help in decoding serial data streams with the limited speed and storage capacity of PBasic, when long character streams can't be stored for decoding later and the PBasic interpreter really isn't fast enough for the decoding to occur on-the-fly with an unbuffered serial input. There are some 3rd party serial input buffer devices that are really pre-programmed PIC processors that could help you do this.

    The Propeller is really a much better platform for this kind of thing. It has 8 independent microprocessors on chip. You could use 6 or 7 of them as serial port monitors, looking for complex data embedded in the data streams. The other processors could act on the extracted data and pass it on to some other processor.
  • edited 2007-05-07 18:18
    I agree with Mike. The Propeller microcontroller is really the right tool for this kind of job.

    There's an inexpensive educational kit that will probably be useful for getting started and prototyping your circuits. Here's a link to a page with information about the hardware and the first four chapters in a getting started book:

    http://www.parallax.com/detail.asp?product_id=32305

    There's also a fifth chapter that's up for draft review and a link to a differential drive robot application here:

    http://forums.parallax.com/showthread.php?p=617192

    Another board you may find useful for prototyping is the Propeller Proto Board. You'll be able to use the Propeller Plug that comes with the Propeller Education kit to program these extra boards. There's lots more resources for projects and getting started can be found on the main Propeller Microcontroller page:

    http://www.parallax.com/propeller/index.asp

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Andy Lindsay

    Education Department
    Parallax, Inc.

    Post Edited (Andy Lindsay (Parallax)) : 5/7/2007 6:29:41 PM GMT
Sign In or Register to comment.