Shop OBEX P1 Docs P2 Docs Learn Events
Dealing with long ASCII strings — Parallax Forums

Dealing with long ASCII strings

Michael O'DoulMichael O'Doul Posts: 19
edited 2005-08-07 18:29 in BASIC Stamp
I've looked around these forums and elsewhere, but I can't find an elegant solution to the following problem. I have a radio beacon -- a simple device that transmits the same 128 byte ascii string over and over again. What I want to do is:

receive the string
check for errors with some version of CRC
If the string is error-free, pass it to another device via RS-232

The first two tasks are easy, but the lack of RAM on the BS2 makes the third task a bit difficult. Is there some way for the stamp to hold onto the entire 128 byte string without resorting to a WRITE command? The length of the string cannot be be shortened.

Any help will be greatly appreciated.

Michael

Comments

  • Bruce BatesBruce Bates Posts: 3,045
    edited 2005-08-07 02:01
    Michael -

    You will be pleased to learn that all of the larger Stamp platforms (BS-2p and upwards) have 127 bytes of SPRAM (scratchpad RAM) available for your use. This SPPRAM can be accessed using the GET and PUT commands, as found in the PBASIC Stamp Manual which is free for the download from the Parallax web site. Data can be read to and written from that area in BYTE (8 bits) or WORD (16 bits) segments. That should give you all the storage space you need for your long data string.

    There was a discussion on using SPRAM on the third of this month (08/03/2005) in this forum if you want to go back and look at it. The title of the thread was "SP RAM HELP". You may find it quite helpful, as there are some examples therein.

    Regards,

    Bruce Bates
  • Michael O'DoulMichael O'Doul Posts: 19
    edited 2005-08-07 18:29
    Thanks Bruce -- I think that might be the best answer, especially since speed is a bit of a concern on this project anyway.
Sign In or Register to comment.