Shop OBEX P1 Docs P2 Docs Learn Events
Quzzical over bs2 — Parallax Forums

Quzzical over bs2

qummyqummy Posts: 16
edited 2006-04-05 10:18 in BASIC Stamp
My project is about the communication between two microcontrollers. I am required to design a frame, that will use 'compare and check' as the error checker on the data sent and received in a supervisory and control system. As I go along, studying the BS2 capabilities,i doubt it support such system.Or am i wrong? I'm sure the BS2 does have greater processing power then sending simple ASCII. Please help.

I've tried using serin/serout for communication.but it seems tht only a bs2 can only transmit and the other receive command and cannot be retransmitted back to the other bs2.is there any other way?

·

Comments

  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2006-04-05 08:37
    I believe that the BS2 is half-duplex. TX and RX are both supported.

    It may be that you are using the 'programing port' which in Debug.
    Since this port has its own 'special' characteristics, you might configure two other pins to be your Tx and Rx, you may even create handshaking Pins.

    Creating a frame will probably be limited only by the amount of available RAM registers to store it.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    "When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)

    ······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
  • GadgetmanGadgetman Posts: 2,436
    edited 2006-04-05 08:53
    Or maybe switching to BS2p or px?

    They can buffer in Scratchpad RAM...

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Don't visit my new website...
  • qummyqummy Posts: 16
    edited 2006-04-05 08:55
    does this means...i have to use 4 pins?
    if so, i have already did that but it does not work together.
  • Bruce BatesBruce Bates Posts: 3,045
    edited 2006-04-05 10:18
    qummy -

    Based on what you've said so far, it appears to me that you're attempting to use a simple asynchrounous serial data transmission method (SERIN/SEROUT) for a complex, synchronous application (ACK/NAK/RETRY), without applying a synchronizing methodology and you're surprised it doesn't work. Where's the surprise?

    It would apear to me that part of this exercise is for YOU to supply the appropriate synchronicity, as well as the error detection and retry capability, I would presume. This must be done not only at the hardware level, so that each side of the "conversation" is ready to accept data from the other, but apparently at the software level as well (your suggestion of "frames"). This is part of your system design and has nothing to do with the capabilities of the platform you're using - PBASIC Stamp or otherwise.

    I'm not about to do this class project for you, but here are a few suggestions. Few if any microcontrollers offer frame-based communication methods. This will be entirely up to you, but here is one methodology (below) which has proven popular for use on the PBASIC Stamp. Only a subset of the total capabilities is possible, due to the limited amount of available RAM:
    http://www.hth.com/snap/

    In addition to using that, or something like it, I would suggest you study up on using FLOW CONTROL with the SERIN/SEROUT commands, to provide the necessary hardware synchronicity that you presently, apparently lack. Lastly, you will be responsible for creating, maintaining, and transmitting some sort of hash-code, or CRC so that the receiving side can check what it read with what the sender transmitted. Only then, when that data differs, can any receiver know enough to request re-transmission.

    There is no failing with the PBASIC Stamp, nor with its capabilities. One just has to know how to apply it properly, and to utilize it in a manner and in keeping with the intended goal.

    Regards,

    Bruce Bates

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    <!--StartFragment -->
Sign In or Register to comment.