Go Down

Topic: Storing data on Arduino DUE (Read 947 times) previous topic - next topic

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.

Gericom


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?
Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

peter247

#2
Mar 20, 2014, 08:28 pm Last Edit: Mar 20, 2014, 08:30 pm by peter247 Reason: 1
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 .
http://peter224722.blogspot.com

Gericom


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)
Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Graynomad

#4
Mar 21, 2014, 03:53 pm Last Edit: Mar 21, 2014, 03:54 pm by Graynomad Reason: 1
Quote
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
Rob Gray aka the GRAYnomad www.robgray.com

samly_dixon

Quote

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.

polypagan

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...
There are 10 kinds of people in the world, those who understand binary, and those who don't.

peter247

What about storing it to a SPI mass storage device , or SD card which it`s normally called.
http://peter224722.blogspot.com

Go Up