Hello, it has 8 Kb for global Variables, I think we talk about 8kb SRAM, on the other side it has 256 kb Flash Memory.
Is there any way to "get" more memory for Global Variables???
Thanks
Hello, it has 8 Kb for global Variables, I think we talk about 8kb SRAM, on the other side it has 256 kb Flash Memory.
Is there any way to "get" more memory for Global Variables???
Thanks
There is no way to increase Ram memory.
but there is usually ways to be more efficient in your use of memory.
Use the smallest data type that the variable will fit in. I.e. If the variable is never larger than 255 use a byte instead of an int.
If a variable doesn't ever change using const will save memory. Ex. const byte x = 1;
Use local variables when possible.
it has 8 Kb for global Variables,
What are you doing that requires more than 8k of global variables ?
Is there any way to "get" more memory for Global Variables???
Variables that change at run time? Or variables that are valued when the code is compiled and never change? Different answers...
1284P = 16K SRAM for variables. (16384 bytes)
I made one application that used 325 x 45 = 14625 bytes of it.
If it never changes it is by definition not a variable. Its a constant or a parameter.
PaulS:
Variables that change at run time? Or variables that are valued when the code is compiled and never change? Different answers...
Hello, first of all thank you all for your advises.
I am with a project for the last year in the university. It is being a Graphics Interface for Domotics systems organized by zones, and I am fully new in this world of Arduino.
So I am looking for the best way to have "the maximun number of buttons" to manage "the maximun number of devices".
Thanks.
pabusa:
Is there any way to "get" more memory for Global Variables???
Typically you can use all the flash memory for "global constants" (fixed at compile time).
You can use internal or external EEPROM for variables that need only slow access and that are seldom changing (limited write cycles, unlimited read cycles).
Another possibility for big amounts of data and slow access time would be: Use an SD-card!
You can also add "external RAM memory" to Atmega controllers (up to total 64 KB RAM), but this will cost you i think 10 of the digital pins. It is rarely done nowadays, because if you need more RAM, you can simply use a DUE.
It is being a Graphics Interface
you can use all the flash memory for "global constants" (fixed at compile time).
In particular, any font tables can be stored in flash...