Shop OBEX P1 Docs P2 Docs Learn Events
memory problem — Parallax Forums

memory problem

julienjjulienj Posts: 9
edited 2008-02-07 15:43 in General Discussion
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

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2008-02-07 06:00
    The only way to store more information than exists on the SX48 is to attach external memory of some kind. The flash memory is used for the program and for fixed data. There is nothing like the WRITE statement.

    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.
  • julienjjulienj Posts: 9
    edited 2008-02-07 06:26
    Thanks Mike for the quick response. I will do a little more homework and see what else I can come up with.

    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
  • RickBRickB Posts: 395
    edited 2008-02-07 15:43
    Consider using serial fram by Ramtron. Much faster than eeprom and nearly unlimited write cycles compared to eeprom and flash. Search for posts on the subject.

    Rick
Sign In or Register to comment.