memory problem
I have a program that constantly transmits a stream of serial data. There are 513 bytes that get transmitted in total. The device also recieves information that gets stored in a memory bank to then be output as a part of the streaming data.
I need a way to store this information dynamically. Something similar to the "write" command on the basic stamp. Is there anything similar for the SX.
If it makes any difference in this case, I am using an SX48, at 20MHz. I already have the working code for the serial stream. I just need a way to store more variables than there is space available on the chip.
Thanks in advance,
julienj
I need a way to store this information dynamically. Something similar to the "write" command on the basic stamp. Is there anything similar for the SX.
If it makes any difference in this case, I am using an SX48, at 20MHz. I already have the working code for the serial stream. I just need a way to store more variables than there is space available on the chip.
Thanks in advance,
julienj
Comments
To the extent that the 513 bytes that have to be transmitted are fixed (never changing), you can store that in the program flash memory along with the program. Depending on the actual data, you may be able to compress it. For example, if the data consists of only upper case letters and digits and some punctuation, you may be able to use 6 bits per character rather than 8 bits and store 4 characters per 3 bytes.
If you want to use an external memory, there are simple parallel static ram chips like www.idt.com/products/getDoc.cfm?docID=12801075 which would need perhaps 22 I/O pins to use 2K bytes. You probably don't want to use EEPROMs because of the limited write capability ... they wear out after 100,000 to 1,000,000 writes to the same location. It may seem like a lot, but could happen quicker than you think with constant use. If you can't afford the pins and high speed is not needed, you could use the NXP PCF8570 (www.nxp.com/pip/PCF8570_4.html) which provides 256 bytes with an I2C interface. You could attach two of these to a pair of I/O pins. SX/B has built-in I2C support routines and I'm sure there are other examples.
All of the data is in byte format rangeing anywhere from 0 to 255, so compression is not really an option.
Thanks for the bit (no pun intended) on static RAM versus EEPROMs too. I have used EEPROMs merely out of convenience in the past, but this application would incur many repeated writes, so that is definitely something to keep in mind. Not to mention that the data will not need to be stored on power down.
Thanks again
Rick