Dealing with long ASCII strings
Michael O'Doul
Posts: 19
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
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
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