Memory question

Status
Not open for further replies.

urbanspaceman

Well-known member
Hi, i'm new (almost)
and i have a question about memory flash and ram

i want to know if the program is compiled and sotred in the internal flash..
in this case if i have a big program and the flash is full, how and where can i store my program?

If i have to store non volatile data, where can i store? in the flash?

Which ram chip i have to buy to work with teensy?

Thanks
 
In the Teensy there is no expansion memory for program and data. If your program is too large to fit in the flash memory that the Teensy has, you are out of luck, and you need to figure out how to reduce the program. The Teensy 3.2/3.1 has 256 kilobytes of flash memory, the Teensy LC has 62 kilobytes, and the old Teensy 3.0 has 128 kilobytes.

Similarly, the read/write data is held in SRAM, and all of your static data, the memory allocated dynamically, and the stack must fit within the SRAM for the Teensy. The Teensy 3.2/3.1 has 64 kilobytes of SRAM, the Teensy LC has 8 kilobytes of SRAM, and the old Teensy 3.0 has 16 kilobytes of SRAM.

The Teensys also have EEPROM that is saved between power cycles (like the code is) that you can use to store values between runs of the program. To access the EEPROM memory, you need to use library functions to read and write the bytes. Note, EEPROM has limited number of write cycles before the memory degrades, so it is a good idea not to update the EEPROM all that often (particularly on the LC). The Teensy 3.2/3.1/3.0 have 2 kilobytes of EEPROM. The Teensy LC has 128 bytes.

If you think this amount of memory is too small, consider that many of the other Arduino-like processors have even less memory. The ATtiny85 chips (used in the Adafruit Gemma and Trinket boards for instance) only have 8 kilobytes of flash (and the bootloader may take 2-2.5 kilobytes of that memory), 512 bytes of SRAM, and 512 bytes of EEPROM. The ATmega328p (used in the Arduino Uno) has 32 kilobytes of flash (with bootloaders taking 2-2.25 kilobytes), 2 kilobytes of SRAM, and 1 kilobytes of EEPROM.
 
Thanks Michael, clear explanation. At this point I think I need only the teensy 3.1 that I already have. The question is on external eeprom to store the data.. Can I use the 25LC512?
 
Status
Not open for further replies.
Back
Top