Shop OBEX P1 Docs P2 Docs Learn Events
prob setting up serin and serout testbed — Parallax Forums

prob setting up serin and serout testbed

trookstrooks Posts: 228
edited 2014-05-19 03:37 in BASIC Stamp
I have a couple of Boe Bots I am trying to use to test some code for eventual use sending serial via RF.

My problem is with setting up the SERIN command. The Syntax and Reference manual is short on examples of how to set up SERIN to load received binary data to a byte variable. I am using cross wired pins from one Boe Bot to the other and have plenty of pause between s/r commands at low baud rate and I am allowing plenty of wait time.

I have tried many versions of the SERIN command code to no avail. (I even cut way back on the pain meds to make sure I was not overlooking something obvious.) Most ways I have tried give me a syntax error of various sorts and the ones that are accepted do not give the desired results.

Does anyone know off the top of their head how to send eight bits of binary from A to B and have B add 1 to the data and send it back?

The serial to RF/RF to serial modules test good with the software that came with them but went dumb when I put them on the Boe Bots to test my code so I fell back to the hard wired plan.


Tim

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2014-05-18 15:41
    The problem is that it's impossible to give you anything but general advice out of context. SERIN is not buffered. It will not see any signal except when the SERIN statement is executing. If you have one BoeBot (Stamp) do: SERIN <pin>,<BaudValue>,[x] then x = x + 1 then SEROUT <pin>,<BaudValue>,[x] this will indeed read an 8-bit value, increment it, and transmit it back. The other BoeBot will have to do SEROUT <pin>,<BaudValue>,[z] then SERIN <pin>,<BaudValue>,[z] and the received value should be one greater than the value sent. This will only work if the first BoeBot is stalled at the SERIN waiting for the value to be sent from the 2nd BoeBot.

    Probably the most straightforward solution would be to use some kind of buffer on each of the BoeBots like those made by Protean Logic (RSB509B or RSB509C).
  • trookstrooks Posts: 228
    edited 2014-05-19 03:37
    Mike,

    Thanks for the getback to my question.

    I took some time to step away from this problem and have come back with fresh eyes and brain.

    This morning I took my first jumbo mug of 'freshly brewed from freshly ground' to my 'mad scientist' lab instead of on my usual predawn to full sunup mosey(hobble?) around the grounds.

    The first thing is that I misspoke the boards I am using. I am using two SumoBot boards and not BOEs. Since they are both BS2 that should be no never-mind.

    I caught your hint about 'general advise out of context' as a sidewise request to look at my code. I do hold a technical degree in programming and later earned college credits for learning new languages and have always been loath to let anyone see my code until I prove to myself that it works. One of the first things I noticed when I laid fresh eyes on the code was that on one module I had specified the data as Word instead of Byte. I am certain that was not helping much.

    I took you advice verbatim and left out the formatters. Now I am getting something(?) to show on both Debug screens. I will be switching to the BOEs if for nothing else but to eliminate the USB to RS232 source of potential problems.

    Today I make my bi-monthly excursion out into the random madness that exist out there in the 'real'(?) world. My first stop is the Huddle House out on the four-lane for an appearance at the daily meeting of the 'over the hill and gaining speed gang'. With a full belly I then proceed on to grocery shopping. Then on to Radio Shack(if it's still there).


    Again Thank You very much for your valued advise,

    Tim

    - I gave up Tai Chi once the grinding, creaking and screaming of my joints cancelled out the serenity gained.
Sign In or Register to comment.