Pages: [1] 2 3   Go Down
Author Topic: RAM RAM I need more RAM!!  (Read 3368 times)
0 Members and 1 Guest are viewing this topic.
Anacortes, WA
Offline Offline
Full Member
***
Karma: 2
Posts: 163
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12861
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

Global Moderator
Netherlands
Offline Offline
Shannon Member
*****
Karma: 216
Posts: 13676
In theory there is no difference between theory and practice, however in practice there are many...
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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? smiley-wink

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

Logged

Rob Tillaart

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

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 534
Posts: 26970
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12861
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


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

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
« Last Edit: March 30, 2012, 12:15:20 am by Osgeld » Logged


Washington
Offline Offline
God Member
*****
Karma: 38
Posts: 790
Firefox & Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

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!

SE USA
Offline Offline
Faraday Member
**
Karma: 41
Posts: 3783
@ssh0le
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

bingo
Logged


UK
Offline Offline
Sr. Member
****
Karma: 7
Posts: 436
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Rapa Nui
Offline Offline
Edison Member
*
Karma: 60
Posts: 2071
Pukao hats cleaning services
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

.. 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  smiley
Logged

Anacortes, WA
Offline Offline
Full Member
***
Karma: 2
Posts: 163
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Global Moderator
Dallas
Offline Offline
Shannon Member
*****
Karma: 206
Posts: 12861
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


If you'd like help...
http://arduino.cc/forum/index.php/topic,99388.msg745270.html#msg745270
Logged

Anacortes, WA
Offline Offline
Full Member
***
Karma: 2
Posts: 163
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hahah!

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

-jim lee
Logged

IRL
Offline Offline
Full Member
***
Karma: 0
Posts: 146
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Maybe use external serial RAM IC.
Logged

I also have PIC related web domain.

Anacortes, WA
Offline Offline
Full Member
***
Karma: 2
Posts: 163
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Main program..

Code:

#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();
  }
}

Logged

Pages: [1] 2 3   Go Up
Jump to: