Questions tagged [sram]

Volatile memory used by Arduino programs for storing variables and other data at runtime.

62 questions
63
votes
7 answers

Is using malloc() and free() a really bad idea on Arduino?

The use of malloc() and free() seems pretty rare in the Arduino world. It is used in pure AVR C much more often, but still with caution. Is it a really bad idea to use malloc() and free() with Arduino?
Cybergibbons
  • 5,420
  • 7
  • 34
  • 51
22
votes
5 answers

How much can I recurse? How much can I recurse? How much ca!@#QFSD@$RFW

The Arduino Uno board has limited RAM which means it has a limited call stack available. Sometimes, recursion is the only quick option to implement a certain algorithm. So, given that the call stack is severely limited, what would be a way to find…
asheeshr
  • 3,847
  • 3
  • 26
  • 61
20
votes
5 answers

I'm using too much RAM. How can this be measured?

I would like to know how much RAM I am using in my project, as far as I can tell, there's no way to actually work that out (other than going through and calculating it myself). I have got to a stage in a rather large project where I have determined…
Madivad
  • 1,372
  • 8
  • 26
8
votes
5 answers

How is stack memory used for fuctions and local variables?

I wanted to save some values to the EEPROM and also wanted to free up SRAM by avoiding some variable declarations, but EEPROM memory is byte wise. If I want to store an int value, I have to use some expressions repeatedly. I thought I would make…
Nafis Abdullah Khan
  • 229
  • 1
  • 4
  • 10
6
votes
2 answers

Why is my SRAM so quickly filled? There are not more than 60 bytes

I have just gone through all my code. At max I use 60 bytes. I have done everything in order to minimize its usage - I even store booleans as bits, not bytes! What could be happening here? The only thing that comes to my mind are extremely large…
SlowerPhoton
  • 195
  • 7
5
votes
2 answers

What's taking up so much RAM in an almost empty sketch?

I wanted to check how much memory (RAM) is used by an "empty" sketch. Here is my code: int freeRam() { extern int __heap_start, *__brkval; int v; return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval); } void setup() { …
rubix_addict
  • 225
  • 4
  • 6
5
votes
3 answers

Sizeof variables and Due's RAM

I set out to see how much space some arrays have. I used this test code bool state = false; uint16_t BuffA[46000]; uint16_t BuffB[20000]; uint16_t BuffC[20000]; uint16_t all = 0; void setup(){ Serial.begin(9600); } void loop(){ if…
user1584421
  • 1,425
  • 3
  • 26
  • 36
5
votes
3 answers

Array + Serial Monitor Problem

I've written a Arduino sketch that converts an analogue voltage to a temperature using a lookup table - code below. I've recently changed my LUT to include more values but ever since that my Serial monitor won't print out my debugging statements…
EoinScully
  • 55
  • 8
4
votes
2 answers

Is there a way to add external RAM (let's say 100 MB or 200 MB) in this audio buffer mixing context?

I'm coding a music sampler device: for fast playback / minimal latency (only a few milliseconds), it's better to have all audio .wav samples we want to use in RAM, so that when some of them are played, the data arrays are immediately accessible.…
Basj
  • 449
  • 2
  • 9
  • 23
4
votes
2 answers

Locally declared variable takes up global variable space in dynamic memory/SRAM

I'm trying to make my Arduino Uno control the air conditioner by recording the raw IR signal of several of the AC remotes temperatures using AnalysisIR. However these IR codes are quite long (array with 343 items). Declaring more than one IR code…
ihish52
  • 41
  • 3
4
votes
3 answers

Is there any way I can connect the RAM of a computer to Arduino?

I was thinking about a way to reuse the RAM of my old computer on my Arduino board. I was thinking about some peojects using neural networks, and more RAM would let the Arduino use more neurons. So that's my question, how could I do that? Maybe…
SrJaimito
  • 141
  • 1
  • 3
3
votes
2 answers

Writing a 1Mb bitmap to an SDcard with only 96kB RAM

My goal is to have an Arduino Due (96 KB RAM) write a +-1MB bitmap to an SD card. I have an array of a several coordinates on my Arduino Due and I would like to generate the bitmap where all the coordinates have a certain color and all the other…
Sven Onderbeke
  • 155
  • 1
  • 7
3
votes
0 answers

Arduino sketch works on ATmega1280, but doesn't work on ATmega328 (Arduino Nano)

I'm working on arduino based RGB LED strip controller. This simple schematic was used to control 12V channels via 5V PWM signal from arduino: I have also connected an HC-05 bluetooth module to be able to control it using android phone. Android…
Firago
  • 31
  • 2
2
votes
1 answer

Am I Running Out of RAM Or Not?

I'm attempting to drive 300 TM1803 RGB LEDs from an Arduino Uno using the FastLED library. My code works fine for 100 LEDs, but when I go to 150, the arrays that store LED values and my sensor data get corrupted, causing the LEDs to flash colors…
ahalekelly
  • 285
  • 2
  • 10
2
votes
2 answers

How can i reduce my global variable use? Attiny85

I'm trying to compile my code but i keep exceeding my global variable memory by 12%. Is there anything i can do in my code to further reduce RAM usage? Or do i have to do modifications to the libraries I'm using? Here is my main program: …
Boyfinn
  • 245
  • 3
  • 11
1
2 3 4 5