Shop OBEX P1 Docs P2 Docs Learn Events
Fastest Communication between 2 Basic Stamp Modules — Parallax Forums

Fastest Communication between 2 Basic Stamp Modules

G McMurryG McMurry Posts: 134
edited 2015-05-26 17:16 in BASIC Stamp
Good Morning,

Here is my challenge for today:

I would like to be able to move a small amount (maybe 20 bytes) of data between 2 Basic Stamp modules ASAP. I am already using 2p and/or sx modules.

Basically, I have two Basic Stamp modules. Lets call them Master and Slave.

Slave is doing a large amount of data acquisition (RCTIME, COUNT, etc.) and Master is handling larger overhead communication tasks. I need to move about 20 bytes of data, on demand and as quickly as possible from the Slave and the Master.

I would like to use something synchronous such as SHIFTOUT to SHIFTIN but I can see how is probably not possible to use those two commands together. I know how I can do this using the asynchronous SEROUT to SERIN but even at the fastest baud rates that can be slow, waiting for a serial stream to start, etc.

I am hoping I can find some way to perhaps use SHIFTIN on the Master and some other means to clock out data fast from the SLAVE. Or, perhaps the other way around, SHIFTOUT from the SLAVE (when it is ready) and a flag that the Master sees to know when it should start clocking in data from the SLAVE. Could this possibly be faster?

The two Basic Stamps would reside on the same board. I would like to use no more than 3 lines, though I might be able to find a 4th.

I was looking at the Microchip 24LC41A Dual Port I2C Serial EEPROM. However, the overhead of I2C may be slower than just using regular SEROUT / SERIN. Put a piece of Dual Port Serial RAM in between the two Stamps. Slave stores it data in the ram and Master reads it whenever it has time.

I would appreciate any thoughts on this topic.

Greg

Comments

  • JonnyMacJonnyMac Posts: 9,014
    edited 2015-05-25 08:17
    You cannot use SHIFTIN with SHIFTOUT from the other side because both instructions assume the BS2 is the master and generate a clock signal. Your best bet is serial. If you want to cut down on wires, use half-duplex, open-collector mode. Use a second wire from slave to master to indicate "data ready" and a third from master to slave to indicate "transmit now"

    You will spin your wheels (and chew through valuable code space) trying to use anything other than serial coms for this kind of app -- just my opinion.


    Another thought, of course, is to replace the two BS2 modules with a single Propeller. No wires necessary to communicate between processors; it all happens through shared RAM.
  • G McMurryG McMurry Posts: 134
    edited 2015-05-26 17:16
    I have moved on to Propeller on a couple of other projects, but this one is a legacy STAMP project and is not likely to change. I will probably do some tests with a high baud rate between stamps and see how it goes.

    I still would like to know if anyone has experience with any two port serial RAM/ROM chips. I think that would be my best solution anyway.

    Greg
Sign In or Register to comment.