how many terms can i save in an array of arduino due?

I'm testing the arduino due's ability, and I want to define an array of 8192 terms, but it doesn't compile, any idea about what is the max capacity of arduino due??

Where is your code ?

A simple test. that does not compile

String array1[8192];

void setup() {
Serial.begin(9600);
}

void loop() {
String dato = "";
for(int i=0; i<8192; i++){
int sensor = analogRead(A0);

array1 = dato;

  • }*

Use code tags to post your code.

You can't define the size of your String as you do. The "reserve" feature should be used instead.

You will find the DUE SRAM size in the tech specifications folder of the DUE product page.

And this works fine:

uint32_t Array[8192];

void setup() {
 
  Serial.begin(250000);
  for (int i = 0; i < 8192; i++)
  {
    Array[i] = i;
  }
}


void loop() {

  for (int i = 0; i < 8192; i++)
  {
    Serial.println(Array[i]);
  }
}

Thank you very much for this valuable information. I will do other tests

everytime you attempt to upload with the arduno compiler, the console at the bottom should tell you the memory size of the chip and how much you are using.

by default your variables store to the ram memory. if you know your variables will not change dynamically during runtime you can declair them into the program memory which is larger.

the code for String ? any limit?

An empty String consumes six bytes of RAM, even on the eight bit AVRs.
I guess on the Due that's even more.

A simple sizeof will give you the exact value.

ard_newbie:
You can't define the size of your String as you do.

That's not defining the size of a String, it is defining an array of Strings.

A String has, as private variables, a buffer pointer, a buffer size (int) and a String length (int).
On an AVR, 2 + 2 + 2 bytes.
I don't have a Due to hand, but I'm willing to bet that's 12 bytes (32 bit pointer and 32 bit ints)

So, 12 x 8192 is . . . 96k bytes.

String array1[8192];

Do the variables have to be Strings ?

What is the source of the data and can you please post some examples ?

The idea is to see Ram's ability. making a string array. and see if memory banks are addressable. please any comments on tests that have been made are important

The idea is to see Ram's ability. making a string array

A string (lowercase s) is not the same as a String (uppercase S)

Can we assume that you mean the latter ?

you right is´t a String no string, 12 byte, now i think in arduino due only use 60 kB of the bank 64 kB but the otrher bank...

taterking:
by default your variables store to the ram memory. if you know your variables will not change dynamically during runtime you can declair them into the program memory which is larger.

PROGMEM - Arduino Reference

Its this relavent for Due?

I have read things that lead me to believe this is not relevant, because Due has an ARM chip which is Von Neumann architecture. So the compiler should put any constant values in flash memory anyway, and flash and ram are part of the same address space, so no special instructions are needed. Contrast that with AVR chips which are Harvard architecture, where flash (instruction memory) and ram (data memory) are in separate address spaces, so special instructions are needed to read data from instruction memory. Can anyone confirm this?

I have never owned a due. but arduino documentiation states that "arduino boards have 3 types of memory". if there where exceptions i would think it would use the word "most" arduino boards or list any exceptions to this format. when you are using the PROGMEM command you are simply hard coding the value of a variable in with the sketch. to function any board MUST have some sort of both ram and rom to function.

every board needs a place to store a scetch that is NOT erased when the board is off.
every board also needs dynamic ram space that can be used and changed for processing.
ram does not hold anything when a board looses power.
this is basic old school computer science that holds true for any computer or smart device. you need both ram and rom to function! in other words it would be impossible to make a board that didnt have a fixed program memory area for sketches.

using the PROGMEM keyword you are setting your variable into the read only program memory space that does not change.

otherwise variables are put into the temporary RAM when the board starts so they can be changed and adjusted during runtime.

https://playground.arduino.cc/Learning/Memory/