Go Down

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

jimLee

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?

Thanks!

-jim lee

Coding Badly


http://arduino.cc/en/Main/ArduinoBoardMega2560
http://ruggedcircuits.com/html/quadram.html

robtillaart

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)

CrossRoads

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.

Thanks!
Robert

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

http://arduino.cc/forum/index.php?action=dlattach;topic=80483.0;attach=14573;image
http://arduino.cc/forum/index.php?action=dlattach;topic=80483.0;attach=14575;image
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


http://www.pjrc.com/store/teensypp.html
http://www.pjrc.com/store/teensypp_pins.html

Osgeld

#5
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

http://hackaday.com/2011/08/01/want-to-play-pong-on-your-oscilloscope/

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?
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

smeezekitty

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!

Osgeld


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


bingo
http://arduino.cc/forum/index.php?action=unread;boards=2,3,4,5,67,6,7,8,9,10,11,66,12,13,15,14,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,86,87,89,1;ALL

cowasaki

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);
  Serial.print(p);
}

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


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."));

pito

.. 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  :)

jimLee

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...
http://arduino.cc/forum/index.php/topic,99388.msg745270.html#msg745270

jimLee

Hahah!

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.

jimLee

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.
 Serial.setTimeout(100);
 aBlinker.init();
 
 // 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;
     index++;
   }
   else if (index>0) {
     command[index] = '\0';
     index = 0;
     if (!strcmp("add",command)) {
       value1 = Serial.parseInt();
       value2 = Serial.parseFloat();
       value3 = Serial.parseFloat();
       thorax.addMapperPoint(value1,value2,value3);
       Serial.print("Added point : ");
       Serial.print(value2);
       Serial.print(", ");
       Serial.print(value3);
       Serial.print(" to mapper ");
       Serial.println(value1);
     }
     else if (!strcmp("view",command)) {
       value1 = Serial.parseInt();
       thorax.mapperPointsToSerial(value1);
     }  
     else if (!strcmp("map",command)) {
       value1 = Serial.parseInt();
       value2 = Serial.parseFloat();
       value3 = thorax.mapPoint(value1,value2);
       Serial.print("Mapping : ");
       Serial.print(value2);
       Serial.print(" to : ");
       Serial.print(value3);
       Serial.print(" with mapper ");
       Serial.println(value1);

     }
     else if (!strcmp("dump",command)) {
       value1 = Serial.parseInt();
       Serial.print("Data for mapper : ");
       Serial.print(value1);
       Serial.println(" as (Time, value)");
       thorax.dumpMapperToSerial(value1);
     }
     else if (!strcmp("clear",command)) {
       value1 = Serial.parseInt();
       thorax.clearMapper(value1);  
     }
     else {
       Serial.println(command);
       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() {

 aBlinker.idle();
 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..
   }
   thorax.walkFwd();
 }
 else {
   if (thorax.stepState == walkingFwd) {
     thorax.park();
     thorax.stopSerial();            // Done with servos for now..
     Serial.begin(9600);            // Set up for commands.
     Serial.setTimeout(100);
   }
   else
     commandCheck();
 }
}



Go Up