Since I keep running out of RAM memory, I'm thinking about adding an external EEPROM mostly to store variable data. Can someone give me guidance on the pros and cons of SPI vs I2C. Which one would be better for my purpose (storing variable data)? True ram memory would probably be better for this but I can't find any articles on interfacing ram to an UNO.
Have you considered using an Arduino Mega instead?
but I can't find any articles on interfacing ram to an UNO.
And you won't because you can't, well not in any reasonable way.
SPI will be a lot faster than I2C, at least for the data transfer but they are both slow.
You could try using FRAM (like the FM24C64), I think they have no write delays.
But really the best thing to do would be to just get a larger Arduino.
Rob
'1284P, 16K SRAM without any external components.
http://www.crossroadsfencing.com/BobuinoRev17/
Onboard USB/Serial with MIKROE-483 from mouser.com, or offboard with FTDI Basic or similar.
Check this out - already funded so it will go ahead:
http://www.pozible.com/project/18609
johnft:
Have you considered using an Arduino Mega instead?
johnft, I might have too - thanks
Graynomad:
but I can't find any articles on interfacing ram to an UNO.
And you won't because you can't, well not in any reasonable way.
Rob
Thanks Graynomad - so I guess that means people have looked into using SRAM and maybe a shift register to reduce pins?
Mega has SRAM option with Rugged Ciruits
http://www.ruggedcircuits.com/html/quadram.html
johnft:
Check this out - already funded so it will go ahead:
http://www.pozible.com/project/18609
Very nice but I'd have to wait until July - that's a long wait for me to finish my project - but thanks anyway - I'll probably order one in July now that I know about it - thanks
CrossRoads:
Mega has SRAM option with Rugged Ciruits
http://www.ruggedcircuits.com/html/quadram.html
Hey CrossRoads, that's pretty cool - do you have anything like it for the UNO?
'328 does not have the direct memory address extension ports like the '2560 does.
I've toyed with making SPI accessible memory shields, not much interest in it, so more of a mental/eagle challenge.
If you need a 1284 based, I sell the one I posted now. Bare boards $6, ~$15-20 in parts for you to build one up.
Been thinking of offering it as a kit or assembled board, haven't pulled the trigger yet.
Graynomad:
SPI will be a lot faster than I2C, at least for the data transfer but they are both slow.
the best thing to do would be to just get a larger Arduino.
Getting a Mega is the obvious solution but it never actually occurred to me to use it for data storage. I got all my data storage sorted out using an SD card on a Uno but I am beginning to realise I might be on the wrong tram. The speed of storage in the Mega's RAM may be as important as the capacity.
I am logging temperatures and water flow. I have only just started with the flow. The schedule is to read all every second and distribute via serial. On every tenth second the data is also sent to cosm and the SD card.
I am concerned about interrupting the flow operations. It may be more elegant to send the data to RAM as it is generated and upload it to SD when things are quiet - like 0400 daily.
I guess this is sounding like I am going to have to learn about arrays again.... Is there some tutrial stuff about writing to RAM and transferring therefrom to SD?
I might be on the wrong tram
Do they still have trams on the north shore?
It may be more elegant to send the data to RAM as it is generated and upload it to SD when things are quiet - like 0400 daily.
Everything depends on
a) Number of bytes being logged per entry
b) Number of entries per day/second/epoc
If a x b > available RAM you can't log all day and save at 0400.
OTOH if b is too fast for the SD card you may have to buffer, as long as there are down times you can do the writing.
etc etc etc.
So you need to determine the speed, frequency and size of the entries and do the maths and/or post the details here.
Is there some tutorial stuff about writing to RAM and transferring therefrom to SD?
Quite likely but I don't know where, have you looked in the playground? Also member fat16lib (I think it was him) posted some pretty fast SD logging code a while back.
Basically you want to organise a FIFO (aka circular buffer) and write bytes into one end and read them from the other to put in the SD.
Rob
Graynomad:
I might be on the wrong tram
Do they still have trams on the north shore?
I rode on the last one, I think it was 1960
Everything depends on
a) Number of bytes being logged per entry
b) Number of entries per day/second/epoc
Yes, I use 400kb/day at the moment but that is over the full 24hrs and I expect to reduce it to about 170k
Also member fat16lib (I think it was him) posted some pretty fast SD logging code a while back.
Thanks, I will check that out.
I expect to reduce it to about 170k
Doesn't matter, still won't fit in internal RAM.
Rob
SPI SRAM, or FRAM to guard against power loss, is pretty quick to write to.
Can add two of these on a protoboard, be storing data in no time
battery backed
You can also find 5V FRAM - SRAM access read/write speeds, but nonvolatile like EEPROM (no battery backup needed)
Graynomad:
I expect to reduce it to about 170k
Doesn't matter, still won't fit in internal RAM.
Dammit, that's the second time I have been confused about memory usage. And I still haven't found out if I actually have a problem.....
Thanks Crossroads.
CrossRoads:
SPI SRAM, or FRAM to guard against power loss, is pretty quick to write to.
Can add two of these on a protoboard, be storing data in no time23LC1024-I/P Microchip Technology | Integrated Circuits (ICs) | DigiKey
battery backed
23LCV1024-I/P Microchip Technology | Integrated Circuits (ICs) | DigiKeyYou can also find 5V FRAM - SRAM access read/write speeds, but nonvolatile like EEPROM (no battery backup needed)
http://www.mouser.com/ProductDetail/Cypress-Semiconductor/FM25W256-G/?qs=sGAEpiMZZMtsPi73Z94q0OKOSVYv1Kg2k27WHKFdR4k%3D
thanks CrossRoads