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 [memory]

Use this tag for memory management or issues in programming.

Filter by
Sorted by
Tagged with
2
votes
2answers
3k views

Arduino String memory allocation

When a String variable is declared and modified inside a function, where does it go? To the heap(as string declaration is a part of dynamic memory allocation) or to the stack(as it is a part of ...
2
votes
1answer
1k views

Arduino Nano memory issue. SD card and LCD screen together

When i am uploading my code to arduino nano, i am getting message about high dynamic memory usage (87%): Sketch uses 17,628 bytes (57%) of program storage space. Maximum is 30,720 bytes. Global ...
0
votes
1answer
352 views

Using PROGMEM in constructor

Is it safe to use PROGMEM variable like dynamically allocated memory (a pointer to PROGMEM variable which is out of scope). I need this so I can generate a variable size (before compilation), ...
0
votes
1answer
345 views

Reading a 10-byte buffer out of a PROGMEM string stored in a string table

I'm storing a large snippet of text in three separate PROGMEM char arrays: const char script1[] PROGMEM = "...."; const char script2[] PROGMEM = "...."; const char script3[] PROGMEM = "...."; The ...
1
vote
1answer
799 views

Storing data on AT24C02 EEPROM chips with Arduino

I have recently come across some 8-pin 128-byte EEPROM chips. I've seen those USB EEPROM chip programmer units, but I was wondering if there is any way I could manually store data on the chip with my ...
1
vote
1answer
1k views

Writing to a SPI memory

Recently I salvaged a BIOS chip (EN25QH16) which has 2 Megabytes of memory (8192 pages, 256 bytes/page). I followed this instructables and it works. I double checked the opcodes because the code is ...
1
vote
1answer
81 views

Is there a way to “list” (in BASIC, or “cat” in LINUX) the current sketch loaded in my xxxDUINO? [duplicate]

I was surprised when I couldn't find an old post where someone asked this question. Seems like a natural beginner, uh excuse me, "newbie" question, but then I'm a throw-back to the days when a home ...
0
votes
1answer
49 views

How to store a string in an object and retrieve it safely later?

I'm writing a program where I will be able to toggle between multiple banks, and each bank has 4 presets on it. Right now, I'm trying to give each preset a name that is assigned on creation. I have ...
0
votes
1answer
1k views

delete or free on object causes Arduino to hand or reboot

I've read a lot about dynamic allocation for strings or buffers, but that's not my case. I plan to implement much blinkers types as classes, all inheriting from a base Action class. I declare an ...
6
votes
1answer
14k views

int VS uint8_t VS uint16_t

This question is quite clear. What are the differences between an int, an uint8_t, and an uint16_t. I know it has to do with bytes and memory but can someone clarify me a bit? Things I want to know: ...
0
votes
2answers
2k views

How to measure free RAM on an Arduino Due in Runtime?

I use this Library to measure my free RAM on a Mega in runtime. But this Library does not work on the Due.
2
votes
1answer
6k views

Using pointers with Arduino

I am learning about pointers. I was wondering how the memory address is defined in programming. I get different outputs depending on the format I choose for memory address. So I was wondering if it ...
1
vote
2answers
2k views

Most memory efficient way to program

I currently know 3 ways to do a program. Which one of them is the most memory friendly. Note that the example code is simple (blinking a led) and the final code will be VERY VERY complex. Also, the ...
2
votes
2answers
3k views

Update variable using buttons

I made a part of code to change the temperature limit for alarm system. On warm days user have to change the temperature limit with buttons and OLED display. The question is: How can the variable ...
3
votes
2answers
394 views

Understanding memory fragmentation due to char arrays in functions

This is similar to: Is this function subject to memory fragmentation? I am trying to get my head around Memory fragmentation in Arduino's and embedded systems in general. Currently I have a ...
0
votes
1answer
63 views

Arduino sketch unexpected behaviour

I am currently in a arduino project to read some parameters from another microcontroller serially and the arduino is supposed to transmit these serially to dweet.io cloud. I use SIM900 modem for this. ...
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 ...
2
votes
1answer
861 views

Is the a low memory alternative to SoftwareSerial?

I'm running a program on a ATtiny85 and running into problems because of a lack of available RAM. When I ran avr-nm on my ELF file I found that SoftwareSerial was taking up a lot of RAM even though I'...
0
votes
2answers
216 views

Would rewriting my code in C help reduce RAM usage? [duplicate]

So my program fails to run because there is not enough room for my variables as well as the Arduino Core and Stack. I can't find any more ways to optimize my program so I'm thinking about just ...
2
votes
1answer
1k views

What is using up all the RAM in my program?

I am running a program on the ATtiny and for some reason I am way over the 512 bytes of RAM that are available to me. This is confusing because when I did the math by hand I should have 432 bytes. ...
5
votes
3answers
12k views

Can you access the EEPROM of an ATtiny with Arduino Code?

I'm attempting to reduce the amount of RAM being used by my program by writing some values to the EEPROM of my micro controller. I'm currently programming on the ATtiny85 which has 512 Bytes of EEPROM....
3
votes
3answers
2k views

How to remove SD card safely

I’m constructing an arduino based sytem that uses a SD card and I’m looking for a way to safely remove the card from the system during operation. One way would probably be to turn of the arduino ...
0
votes
1answer
50 views

Arduino tool to enumerate where RAM is being used? [duplicate]

In a sketch I have, I use a few libraries and have discovered that a large amount of RAM is being consumed. Is there a tool that can identify how this RAM is being allocated, e.g. which libraries, ...
1
vote
1answer
512 views

EEPROM - Storing Static Data

I'm trying to store four items to EEPROM. I can do one item no problem, I just don't know how to make the jump to multiple items. My code: #include <EEPROM.h> char sgrpID[31] = "acpilot's ...
1
vote
1answer
1k views

Arduino Memory Best Practice

So I have been diving deep into AVR programming and have seen several different ways of defining constants. I know that some of these methods are from "C" and others are from more modern "C++" methods....
2
votes
3answers
2k views

Simple memory chip for Arduino?

My basic question is: What is a good alternative to EEPROM chips for external memory on the Arduino Unor R3? I know that there are EEPROM chips when one would like an external memory chip. It, in ...
5
votes
3answers
9k views

How much code can an Arduino board run?

I'm getting back up and running with microcontrollers after about 5 years of hibernation time, and I am trying to understand a lot of different things. I have been experimenting with Arduinos for the ...
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.