Go Down

Topic: RAM RAM I need more RAM!! (Read 6422 times) previous topic - next topic


I really like my Arduino uno and have great fun making it do things. But.. the  2K of RAM is driving me nuts! What options are out there that program like the Arduino but have more RAM to play with?


-jim lee

Coding Badly



The 2K of RAM is one of the things that makes Arduino fun!

Mind you the Apollo 11 got to the moon with less RAM and you are complaining? ;)

What kind of application do you make that needs more RAM?

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)


Sounds like you need one of these:
1284 thruhole, Duemilanove style boards!
Prices shipped to US locations:
1-lot $4.50
2-lot $6.75
3-lot $9.25
5-lot $17.00
10-lot $28.25

I ordered 50 of them, sent out about 1/2 so far.

I'll see if I can get one asssembled & a picture posted.


(Rats - I don't have regulators. Knew I forgot to order something when I last ordered stuff from anyone.)

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Coding Badly



Mar 30, 2012, 07:02 am Last Edit: Mar 30, 2012, 07:15 am by Osgeld Reason: 1
outside of audio and video I find 2k to be quite spacious, but I spend time nitpicking details (ie not using a 16 bit integer for a variable that counts to 12)

I usually use arduino with tiny chips which boast 512 BYTES of ram and dont run out, heck even did some graphics with one


so, what are you doing that really requires ram? and is it just crap that could be shoved to other storage medium (such as strings or whatnot) and never be changed? or is are you doing some seriously complex stuff that really requires it to be in volatile memory?


Please give more details.
I find most people that have problems with ram have large static arrays that can be put in PROGMEM.
Avoid throwing electronics out as you or someone else might need them for parts or use.
Solid state rectifiers are the only REAL rectifiers.
Resistors for LEDS!


Please give more details.
I find most people that have problems with ram have large static arrays that can be put in PROGMEM.



Just as a starter here is something that I use to reduce RAM requirements:

void serialPrint_P(const prog_char* s){
  char* p = (char*)alloca(strlen_P(s) + 1);
  strcpy_P(p, s);

void lcdPrint_P(const prog_char* s){
  char* p = (char*)alloca(strlen_P(s) + 1);
  strcpy_P(p, s);

in sketch:

serialPrint_P(PSTR("This text is going to be going to the serial port.  If I used the normal Serial.print command it would go there via RAM wasting lots of space in the process.  The lcdPrint_P function does the same thing for LCDs.  Have a nice day."));


.. for example there is an external ramdisk (currently 4Mbytes) connected via 11 wires only. R/W speed on pic32 is 7MBytes/sec (with bitbanging).
See http://retrobsd.org/topic/ramdisk-for-swap/
You may try with SPI serial FRAM (made by Ramtron) or MRAM (made by Everspin). On arduino connected via SPI you may
get few hundred kBytes/sec. P.
PS: for Apollo AGC ram spec see http://en.wikipedia.org/wiki/Apollo_Guidance_Computer  :)


Sorry, been away.

I'm running 18 R/C servos on three different time functions. The functions are loaded via the serial port point by point into RAM. Then I use liner scaling to interpolate between the entered points in time. To coordinate this I have time objects that "go off" at prescribed times to tell the servos its time to recalculate positions and send out the next set of position info.

I'd got it all going for a single servo, tested all the bits. Worked wonderful. But, when expanding up to 18 times the size.. Well, it went bananas. I figured; "I doubt this'll fit in 2k, maybe I should look for more headroom?"

I come from the c++ application world so I have no RAM usage discipline at all.

-jim lee

Coding Badly

If you'd like help...



Ok but I'm going to be out of town for a week. Next week I'll post it.

-jim lee


Maybe use external serial RAM IC.
I also have PIC related web domain.


Main program..

Code: [Select]

#include "antThorax.h"
#include "blinker.h"

#define buttonPin 2

blinker  aBlinker;
antThorax thorax;

char command[20];
byte index;

void setup() {

 pinMode(buttonPin, INPUT);
 index = 0;
 Serial.begin(9600);            // Set up for commands as default.
 // Skip doing this through the serial port.. Lets hardcode it for now..
 thorax.addMapperPoint( 0, 0, 0);
 thorax.addMapperPoint( 0, 5, 0.66);
 thorax.addMapperPoint( 0, 20, 1);
 thorax.addMapperPoint( 0, 25, 1);
 thorax.addMapperPoint( 0, 45, 0.66);
 thorax.addMapperPoint( 0, 55, -0.66);
 thorax.addMapperPoint( 0, 75, -1);
 thorax.addMapperPoint( 0, 95, -0.66);
 thorax.addMapperPoint( 0, 100, 0);

 thorax.addMapperPoint( 1, 15, -1);
 thorax.addMapperPoint( 1, 20, 0.33);
 thorax.addMapperPoint( 1, 25, 0.5);
 thorax.addMapperPoint( 1, 75, 0.5);
 thorax.addMapperPoint( 1, 77.5, -.5);
 thorax.addMapperPoint( 1, 85, -1);

 thorax.addMapperPoint( 2, 15, -1);
 thorax.addMapperPoint( 2, 20, .25);
 thorax.addMapperPoint( 2, 25, 0.5);
 thorax.addMapperPoint( 2, 75, 0.5);
 thorax.addMapperPoint( 2, 77.5, -0.5);
 thorax.addMapperPoint( 2, 85, -1);

void commandCheck(void) {

 int  value1;
 float value2, value3;
 byte inByte;

 if (Serial.available() > 0) {
   inByte = Serial.read();
   if (isalpha(inByte)) {
     command[index] = inByte;
   else if (index>0) {
     command[index] = '\0';
     index = 0;
     if (!strcmp("add",command)) {
       value1 = Serial.parseInt();
       value2 = Serial.parseFloat();
       value3 = Serial.parseFloat();
       Serial.print("Added point : ");
       Serial.print(", ");
       Serial.print(" to mapper ");
     else if (!strcmp("view",command)) {
       value1 = Serial.parseInt();
     else if (!strcmp("map",command)) {
       value1 = Serial.parseInt();
       value2 = Serial.parseFloat();
       value3 = thorax.mapPoint(value1,value2);
       Serial.print("Mapping : ");
       Serial.print(" to : ");
       Serial.print(" with mapper ");

     else if (!strcmp("dump",command)) {
       value1 = Serial.parseInt();
       Serial.print("Data for mapper : ");
       Serial.println(" as (Time, value)");
     else if (!strcmp("clear",command)) {
       value1 = Serial.parseInt();
     else {
       Serial.println("add m x y adds point to mapper m.");
       Serial.println("view m lists mapper m");
       Serial.println("map m x returns a mapped point from mapper m.");
       Serial.println("clear m empties mapper m.");
       Serial.println("dump m returns the curve for mapper m.");

void loop() {

 if (!digitalRead(buttonPin)) {
   if (thorax.stepState != walkingFwd
     && thorax.stepState != startingToWalk) {    // If we are not walking..
     Serial.end();                          // kill the serial port.
     thorax.startSerial();                  // Let the thorax have the port..
 else {
   if (thorax.stepState == walkingFwd) {
     thorax.stopSerial();            // Done with servos for now..
     Serial.begin(9600);            // Set up for commands.

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131