Pages: [1]   Go Down
Author Topic: Storing data on Arduino DUE  (Read 917 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 143
MKDS hacker and Programmer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

Sheffield --- UK --
Offline Offline
Sr. Member
****
Karma: 0
Posts: 377
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 .
« Last Edit: March 20, 2014, 02:30:57 pm by peter247 » Logged


The Netherlands
Offline Offline
Full Member
***
Karma: 1
Posts: 143
MKDS hacker and Programmer
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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)
Logged

Subscribe my youtube channel: http://www.youtube.com/user/MKDS3

nr Bundaberg, Australia
Offline Offline
Tesla Member
***
Karma: 130
Posts: 8620
Scattered showers my arse -- Noah, 2348BC.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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
« Last Edit: March 21, 2014, 09:54:39 am by Graynomad » Logged

Rob Gray aka the GRAYnomad www.robgray.com

Offline Offline
Newbie
*
Karma: 0
Posts: 7
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Berea, KY, USA
Offline Offline
Jr. Member
**
Karma: 1
Posts: 60
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
Logged

There are 10 kinds of people in the world, those who understand binary, and those who don't.

Sheffield --- UK --
Offline Offline
Sr. Member
****
Karma: 0
Posts: 377
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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


Pages: [1]   Go Up
Jump to: