Podcast #128: We chat with Kent C Dodds about why he loves React and discuss what life was like in the dark days before Git. Listen now.

Questions tagged [sram]

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

Filter by
Sorted by
Tagged with
50
votes
8answers
76k views

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 ...
19
votes
5answers
7k views

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 ...
19
votes
5answers
6k views

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 ...
8
votes
5answers
4k views

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 ...
6
votes
2answers
1k views

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 ...
5
votes
3answers
1k views

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(){ ...
5
votes
3answers
1k views

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 ...
4
votes
2answers
2k views

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) ...
4
votes
2answers
717 views

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 ...
4
votes
2answers
136 views

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 ...
3
votes
1answer
115 views

Local variable usage in SRAM not counted

I use the following code to print the currently used SRAM space: // this function will return the number of bytes currently free in RAM // written by David A. Mellis // based on code by Rob Faludi ...
2
votes
3answers
336 views

What is the most memory-friendly way to declare integer literals?

I'm having SRAM overflow problems with my 8bit atmega328p in my Arduino Uno, which has 2KB of SRAM, so I'm defining all my for loops with bytes as counters instead of ints. As in: for(byte i=0;i<...
2
votes
3answers
4k views

How to write data in RAM memory using Arduino Uno or Arduino Due?

I know that it is possible to write data in ROM(Read Only Memory). But what about if I want to write data in RAM(Random Access Memory)? Can I do it using "Arduino Uno R3"? RAM is normally associated ...
2
votes
1answer
806 views

Measure SRAM usage

I am using an Arduino with 2048 bytes of SRAM. I have a complex project so that it is no longer obvious how much SRAM it would use in total (there is not one large dominant object but many different ...
2
votes
2answers
401 views

Can I make existing libraries use external SRAM for the Arduino

I am running out of memory on my Arduino due to the libraries I am using. After I have included all the libraries I need then there is very little in the way of free memory for my own code. If hook ...
2
votes
1answer
501 views

Are my arrays stored in sram or in Flash?

I have the following memory allocation: unsigned char g1[]={ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ....0x00 ,0x00 ,0x00 ,0x00 ,0x00 }; g2[]={ 0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 ,0x00 .......
2
votes
1answer
657 views

Does the StringObject.reserve() function prevent memory fragmentation/leaks?

I'm currently writing and testing a professional Arduino application, I'm aware of the dangers of using the String class, so I began to implement C-style strings in some places, but it's just way ...
2
votes
1answer
817 views

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 ...
2
votes
2answers
633 views

Arduino Due SRAM

I'm trying to create an array in Arduino Due and when the array exceeds the size of 32768 integer elements the compiler (Atmel Studio) complains. I read that Arduino Due SRAM size is 96K in 2 banks....
2
votes
1answer
94 views

Inherent delay running EEPROM.read()

I'm using EEPROM to store long term data for use in sketches (thanks to DarthRubik for the guidance). I store stuff like a location ("Garden") and a device name ("Greenhouse Monitor 02") plus ...
2
votes
1answer
693 views

Saving byte array in PROGMEM instead of SRAM

For an ethernet project I do, I need to store the Ethernet Shield's MAC address. I store it like that: byte mac[] = { 0x90, 0xA2, 0xDA, 0x0F, 0xE1, 0x85 }; That works OK, but in my project I need ...
2
votes
0answers
47 views

Interfacing with TC5564APL-15 paralell static ram [closed]

I've found a Z80 processor and a TC5564APL-15 8K static ram chips, and I want to test the RAM chip, because it's really old and I'm not sure that it's not damaged. I do not have any experience with ...
2
votes
0answers
1k views

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 ...
1
vote
2answers
104 views

Confusion with storage of declared variables and volatile

I read that volatile is used when we want to store variables in SRAM. But aren't all the variables in a code are stored in SRAM anyway? And what makes it an advantage sometimes for variables(like ...
1
vote
2answers
585 views

Forensic security of Arduino (SRAM)

Pardon the double post, but I'm not getting much traction with this question over at arduino.cc so I'm looking for answers here now. Original post: http://forum.arduino.cc/index.php?topic=391698.0 ...
1
vote
3answers
434 views

Is it possible to configure FRAM memory for use as stack and heap?

I'm using the Adafruit I2C FRAM breakout board with my Nano and it works as advertised, but every time I write a variable to this thing I have to use library function calls with addressing. This makes ...
1
vote
3answers
3k views

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 ...
1
vote
2answers
83 views

Possible to determine at runtime whether a pointer is declared PROGMEM?

Is it possible to determine at runtime whether a pointer points to PROGMEM'ed values or regular values? This would give some flexibility when writing code that handles both.
1
vote
1answer
266 views

How is it possible to access the CPU registers using memory addresses?

The following is taken from ATmega328-328P Data sheet. According to this, I can access all the 32 registers in CPU using memory addresses. For example: unsigned char *register = 0x0; will access ...
1
vote
2answers
440 views

Executing machine code at runtime Uno

I want to create a small single threaded os for my arduino.The first thing I want to do is to allow my arduino to read a section from flash/eeprom and execute it. I have some question regarding the ...
1
vote
2answers
2k views

Which library to use for 23LC1024 SRAM 1 Mbit

I noticed there are quite some libraries for the 23LC1024 SRAM 1 Mbit memory: SpiRam Extended library SpiRam library Direct SPI ? I tried 1 and 3 so far. What I noticed was that to read 1 byte took ...
1
vote
1answer
125 views

Resistors/capacitor used in connecting 23LC1024 SRAM 1 Mbit

Yesterday I received by 23LC1024 SRAM with 1 Mbit memory. I tried to search for some libraries and ways how to connect it. So I searched around on internet first for the connections and saw some ...
1
vote
1answer
2k views

Global memory reduction when using SPI/SD

I want to use an SD card and when including the library both SPI.h and SD.h are included. Also later I want to use an external SRAM chip (probably using SPI.h as well). However, without the SRAM chip ...
1
vote
1answer
654 views

Atmega2560 + weather station freezing

i made a weather station which is build on a ATmega2560 mini pro, Esp8266 module which communicate with atmega on serial1 which sends values to thingspeak, an TSL2561, 2.4 tft lcd, BMP180, DHT22 and a ...
1
vote
1answer
95 views

Unable to turn off SRAM 23LC1024 connected to Arduino [closed]

I'm trying to reset SRAM 23LC1024 (Turn it off and turn it on again) connected to my Arduino Mega 2560. I need to do that because I want to profile the SRAM in an attempt to implement PUF. Currently, ...
1
vote
0answers
371 views

Time to read/write memory on the DUE

I am onto a project where a need more memory. I saw the 23LC1024 chips are very popular with the Arduino DUE. A very helpful person told me he did some timing tests on the 23LC1024 and a page read/...
0
votes
3answers
584 views

Arduino constant vs Microchip PIC constant

2.2 THE BASICS OF C PROGRAMMING LANGUAGE book is has like this, CONSTANTS A constant is a number or a character having fixed value that cannot be changed during program execution. Unlike ...
0
votes
2answers
852 views

What shift register would I need for input OR output?

Background: A few days ago I received a 23LC1024 1Mbit SRAM chip, which works like a charm. However, before I ordered that one, I ordered a LP621024D-70LL which also is a 1 Mbit SRAM but in DIP32 ...
0
votes
1answer
163 views

Is SRAM erased when putting Arduino into sleep_mode_pwr_down?

Question In the interest of reducing power consumption, I am putting the Arduino into sleep mode between taking sensor readings. However, the data from readings are stored in arrays, and must not be ...
0
votes
1answer
382 views

Space needed for local String variable

I tried to run this code on my Arduino Uno clone (which has no function so far and is a shortend version of my programm): String rules [16][5] ={ {"B0 B5", "", "", "cs S0", "", }, [...] }; ...
0
votes
2answers
197 views

Is it ok to declare variables inside timer interrupts?

I am building a real time audio application using the Arduino DUE. This application needs big arrays like: uint16_t sDelayBuffer0[46000]; The Due has only 96kb of RAM available so this array just ...
0
votes
1answer
78 views

Question about configuration EEPROM or Flash

I want to make an external (not related to Arduino) computer application that creates a big 'setup file' (like max. 64 KB). This setup file contains lookup tables (which are configurable and the ...
0
votes
1answer
143 views

Arduino due temperature reading shows random temperatures

I am using an Arduino Due board to read three temperatures from three separate smt160-30 digital sensors but the program is behaving very randomly. the code I am using is one I got from arduino ...
0
votes
1answer
716 views

Store 3-dimensional char array in program memory with PROGMEM

I'm running a sketch whith a quite big, constant three dimensional char array (or simply, a table of strings). As this takes lots of RAM I'd like to store it in programm memory in order to keep the ...
0
votes
1answer
510 views

How to store/get MIDI SystemExclusive data?

In the MIDI library from the Arduino (FourtySeven MIDI library), there exist a function to get the length and bytes of a System Exclusive message: Functions getSysExArray() template<class ...
0
votes
1answer
69 views

Current available SRAM? [duplicate]

I've reached the limit on available SRAM memory. I need to "cut down" some variables, but I actually don't know how far I need to go with it. Is there a way on measuring current available memory on ...
0
votes
1answer
40 views

Arduino Mega and LP621024D70LL

I'm intending to try a LP621024D70LL (128 KB SRAM memory, 32 pins) on an Arduino Mega. However, I now see there is no library for it ... I wonder how hard it is to access it? I can miss 32 digital ...
0
votes
2answers
3k views

Clearing SRAM in loop()

Very broad question here. I don't know exactly what the problem is but I'll edit this post as we narrow down the possibilities. I think I'm running into memory constraints. I'm running a sketch ...
0
votes
1answer
32 views

Dynamic memory 'new' (of an overridden class) call affects SRAM memory

I have made a quite large program (not executed at an Arduino lately). However, if I compile with the next fragment: void LightSetupClass::CreateFixtures() { for (fixture_number_t fixtureNumber =...
0
votes
1answer
76 views

LDC paired with Arduino locks up and freezes. Out of SPRAM?

I am making an alarm clock using a 4x20 lcd display, rtc, and Arduino Pro Mini 3.3v. I have implemented a menu system for setting the time/date that blinks the text on the lcd display to indicate that ...