Pages: [1]   Go Down
Author Topic: string management and memory limitation  (Read 673 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
Just starting with Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello Arduino fans

I'm a bit new at this but willing to learn.  I am building a module to display text messages scrolling on a 16 by 2 LCD display.  Now please confirm but I think the addition of an SD card will be required to hold the text strings.  Or perhaps some kind of physical memory chip or other board would be better?  I would like the string values to remain after a power failure.
« Last Edit: March 27, 2014, 01:40:43 pm by Pierre7 » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8842
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you use a string constant ("This is a string constant") it is compiled into FLASH (*a.k.a Program Memory or 'progmem') and then copied to RAM at run time.  If you are using it for .print() or .println() you can use the F() macro (stream.print(F("This is a string constant"))smiley-wink to keep the string in FLASH and print it directly from FLASH so it does not take up RAM.

There are also ways to keep lists of strings in FLASH.  See: http://arduino.cc/en/Reference/PROGMEM
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
Just starting with Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks for pointing that out however I need to be able to manipulate the strings  something that cannot be done in flash . Perhaps some other type of memory could do the job? I do not mind adding a cr2032 batt to maintain state. Or use an SD card?
« Last Edit: March 27, 2014, 08:12:07 pm by Pierre7 » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8842
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

If you don't need all the strings in their 'manipulated' form at the exact same time you could always manually copy from FLASH to RAM buffer and do the manipulation there.  The buffer can be used for any number of string manipulations.

There is no way to add more RAM so whatever you connect to store strings you will have to copy the string into RAM to manipulate it and copy it back out to auxiliary memory for free up the RAM for the next manipulation.  There is a type of SPI memory called FRAM that I have heard is both non-volatile and fast: http://www.kerrywong.com/2012/01/15/using-fram-as-nonvolatile-memory-with-arduino/
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
Just starting with Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

If you don't need all the strings in their 'manipulated' form at the exact same time you could always manually copy from FLASH to RAM buffer and do the manipulation there.  The buffer can be used for any number of string manipulations.

There is no way to add more RAM so whatever you connect to store strings you will have to copy the string into RAM to manipulate it and copy it back out to auxiliary memory for free up the RAM for the next manipulation.  There is a type of SPI memory called FRAM that I have heard is both non-volatile and fast: http://www.kerrywong.com/2012/01/15/using-fram-as-nonvolatile-memory-with-arduino/

http://upgradeindustries.com/product/7/FRAM-X-Add-on

Thanks for the FRAM tip. I will consider it seriously. I am assuming that it is way better than file/string runtime manipulation via an SD card?
Also according to arduino documentation

-Flash memory (program space), is where the Arduino sketch is stored.
-SRAM (static random access memory) is where the sketch creates and manipulates variables when it runs.
-EEPROM is memory space that programmers can use to store long-term information.


According to FRAM-X Add-on
512 bytes of non-volatile, ultra-lower power memory via I2C, which directly replaces EEPROM and FLASH.

What are the impact. Will the sketch load normally?

« Last Edit: March 28, 2014, 07:16:35 am by Pierre7 » Logged

Massachusetts, USA
Offline Offline
Tesla Member
***
Karma: 208
Posts: 8842
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

512 bytes of non-volatile, ultra-lower power memory via I2C, which directly replaces EEPROM and FLASH.
They mean that the FRAM chip has the same interface as common EEPROM and FLASH chips so it can be used as a drop-in replacement for such chips.
Logged

Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

Offline Offline
Jr. Member
**
Karma: 0
Posts: 66
Just starting with Arduino
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

512 bytes of non-volatile, ultra-lower power memory via I2C, which directly replaces EEPROM and FLASH.
They mean that the FRAM chip has the same interface as common EEPROM and FLASH chips so it can be used as a drop-in replacement for such chips.
What are the impact. Will the sketch load normally?
Logged

Pages: [1]   Go Up
Jump to: