Storing data on Arduino DUE

Hi,
I wanted to store information on the arduino DUE board. I want to store the readings taken from four different types of sensors every 5s. How can I accomplish this, as most of the examples shown are in relation to other boards? How do I store these values into the FLASH memory? Any help or guidance would be appreciated.

edptings:
Hi,
I wanted to store information on the arduino DUE board. I want to store the readings taken from four different types of sensors every 5s. How can I accomplish this, as most of the examples shown are in relation to other boards? How do I store these values into the FLASH memory? Any help or guidance would be appreciated.

Why do you want to save in flash?

Did you read the bit where it says :- 96 KBytes of SRAM
That means that the Due as most ram than most Arduino have flash / eeprom / sram put together.
o.k 96k of ram , 5 seconds , 4 sensors
4 sensors at 32 bits each ( 4 bytes ) 4 * 4 = 16 byte
96k and say 80k usable ? ( 80 * 1024 ) / 16 = 5120 * 5 seconds = 25600 seconds of 4 sensor data.
25600 / 60 / 60 about 7 hours of data , without storing it , And you can double that for you only need 16 bit per cell .

peter247:
Did you read the bit where it says :- 96 KBytes of SRAM
That means that the Due as most ram than most Arduino have flash / eeprom / sram put together.
o.k 96k of ram , 5 seconds , 4 sensors
4 sensors at 32 bits each ( 4 bytes ) 4 * 4 = 16 byte
96k and say 80k usable ? ( 80 * 1024 ) / 16 = 5120 * 5 seconds = 25600 seconds of 4 sensor data.
25600 / 60 / 60 about 7 hours of data , without storing it , And you can double that for you only need 16 bit per cell .

Yea, I know the arduino due got not a lot of ram, but I am not sure if storing in the flash is a good idea. Maybe you can better get an external memory chip the sam3x can interface natively. (Look in the datasheet)

How do I store these values into the FLASH memory?

Short answer: You don't.
Longer answer: You can using special ARM instructions but it's not a great idea.
Another answer: Use an external EEPROM with an SPI or I2C interface.

Actually I think there is now a library that emulates EEPROM in the flash memory, but I still think it's bad idea to spam what is essentially program memory with data.


Rob

Another answer: Use an external EEPROM with an SPI or I2C interface.

Dear Rob,

I am building a running time counter for a machine to find out the time the machine runs. I am thinking to store the running times in a EEPROM in case if any power failure occurs I could be able to recover the stored running duration.. Can you please suggest what would be the best idea? external EEPROM or built in EEPROM? BTW I am using Arduino UNO.

Thank you.

All the replies make good points.

I do note that the EEPROM on AVR's is seldom used. I'm working on a routine to not only store constant stuff (like character generator tables for LCD) in EEPROM, but also to manage EEPROM use with a very primitive directory structure, so sketches can find the base address of tables in EEPROM.

Almost working, I'll post soon.

EEPROM is likely too small for what you need however, huh?

Slow to write, fast(-ish) to read, non-volatile, good for 1,000,000 writes...

What about storing it to a SPI mass storage device , or SD card which it`s normally called.