Pages: [1]   Go Down
Author Topic: Due EEPROM alternative? SD?  (Read 3680 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello all,
I’m very new to arduino and am currently working on a linear positioning system using an arduino mega, as stepper motor and the accelstepper library. I am only able to get about 1000 pulses per second out of the mega due to the speed of the device. I just received my faster Due and it is capable of roughly 4000 pulses per second, so I’m planning on sticking with the Due. My machine has two buttons to adjust speed, one increases the speed by 1 and the other decreases the speed by 1. Currently I am storing the speed value using EEPROM so after a power cycle the speed will be at the last used value. My new Due does not have the ability to do EEPROM writes, so I’m looking for another method.

I have just attached an SD card reader to my Due and have successfully done read/write to a file. However due to the way arduino reads the text file I need to do some conversion to end up with the correct value (I believe this has something to do with ASCII).

Here is what i'm trying to do
Save a variable or a set of variables as values to a text file on my SD card (or multiple text files, one per variable if that is easier)
Perform power cycle
Read values from SD card and assign them to variables
Every time a variable changes, the value in the SD card would be overwritten.

Essentially I’m looking for a way to replace the standard EEPROM function with an SD card.
Speed is the simplest of all the variables and will be in the form of 1 to 100.
I also need position values to two decimal places.

Any help is greatly appreciated
Thanks

Logged

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

Why not use an external EEPROM?

They are cheap and almost never wear out compared to the SD card and you can pick up something like the 24LC256 for very cheap.

https://www.sparkfun.com/products/525
Logged

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

That looks promising, what library do I need to interact with it? Will it act the same or similar to the standard arduino EEPROM.

On a side note I was able to read numerical values from my sd card and import them into a variable. I don't think it will be a very fast process though.

Logged

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

i am writing and reading 512 byte buffer dumps to an SD card in 1.1 ms while running an external interrupt and doing a fair amount of processing. SDfat works about two to four times faster than the original SD library and also has a bunch of fun methods.
Logged

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

Hi,
I am using SST25VF016B flash (2 MB) with DUE and I am quite happy with it. I am writing a small Lib to interface with it. You can find it here: http://luca72.xoom.it/td5mapsuiteweb/archive/FlashLib.zip. It is not yet finished, but quite complete. It is pretty fast (I drive SPI bus at 42 MHz, DUE half speed) and you can address it as if it was an EEPROM.
Luca
Logged

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

i am very interested in this. how complete is the library? can i start fiddling with it as it is or is there anything to look out for? i tried unsuccessfully to get similar chips to work with the digilent chipkit board which is one of the reasons i switched over to the DUE. it took me just a day to rewrite a major sketch to work on the DUE and it is perfect with the SDfat library that was not available for the chipkit.

i bought some Micron 5PQs because they are 128 meg and looked very useful. the instruction set is similar to the one you are using. i was never able to get it to work reliably. do you have any interest in checking the data sheet, comparing to the EEPROM you are using and possibly add it to the library? i would love to have 128 (8 by 16 meg) meg available for high speed data aq. dual or quad read/write modes would be great but not essential.
Logged

Forum Administrator
Milano, Italy
Offline Offline
Sr. Member
*****
Karma: 23
Posts: 292
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

LucaV72

please, remember to put a link to your library here

http://arduino.cc/forum/index.php/topic,144446.0.html

when you are done!
Logged

C.

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

Quote
how complete is the library?
The library is almost complete, I tested it succesfully on one of my SST25VF016B chips. I was able to read single and continuous byte, write single byte and erase  the whole chip. Plus I can write and read the status registry  (writing is necessary at startup to remove area protection) and read the chip vendor info. Missing parts are: 32K and 64K block erase and continuous writing (word). I will use it embedded in a 5" TFT touchscreen (it has to be soldered) I have ordered some days ago. Once the tft has arrived I will finish the library.

I do not know Micron 5PQs but I will check the datasheets. I do not think it will be difficult to adapt the library if it is a serial Flash via SPI. Of course I have to find a couple of chips to experiment on.

Quote
please, remember to put a link to your library here
http://arduino.cc/forum/index.php/topic,144446.0.html
when you are done!
I will!!!

Luca

Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 17
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So the DUE does not have internal EEPROM at all?
Logged

Offline Offline
Jr. Member
**
Karma: 5
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So the DUE does not have internal EEPROM at all?

No, only Flash.
Logged

Laguna Hills, CA 92653
Offline Offline
Full Member
***
Karma: 0
Posts: 112
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Any update on this Library?

-------
The official EEPROM library is still listed in the Standard section of
the Reference Library information, rather than in a Not-for-Due section.

Also, in the description of the EEPROM library itself, there is no mention
of the Due, that it has no EEPROM, or what alternatives might be useful.

Also, a Warning that writing to flash is not the same, since all the flash
is erased whenever the software is updated.

--------
Is there usable, non-volatile memory in the RTC?
Since the RTC is reset with each power-On or Reset, it is mostly
useless, so if it has real EEPROM, that could be used?

Logged

Cheers, Gary
Due for controlling Electric car charging.
Nissan LEAF - Mini Quick Charge (mQC)

Offline Offline
Jr. Member
**
Karma: 5
Posts: 75
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Is there usable, non-volatile memory in the RTC?
Since the RTC is reset with each power-On or Reset, it is mostly
useless, so if it has real EEPROM, that could be used?

The RTC does not have any EEPROM, it has RAM which retains state while VDDBU is powered (as does the RTC unit). On the Due VDDBU is connected to 3V3. Even if you found a way to power the RTC via a battery, it looks like it only has two words you could use for user storage.

Really the best thing is to have a genuine external serial EEPROM, it's a pity the Due does not have one. They are quite small and cheap, perhaps Due v2 will have one.

It would be possible to hack one in by wiring to the SPI header and gluing the EEPROM on top of the SAM3X8E, just needs a SOIC8 breakout board.
Logged

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

If you're willing to do a little hardware and software mod, the Due can be made to use the flash available on the 16u2. See my writeup at http://forum.arduino.cc/index.php?topic=191298.0
Logged

Pages: [1]   Go Up
Jump to: