How to store Data fast in RAM

Hallo, I can measurement data of about 1 Mio samples per second. I can handle this on my Arduino Due, but I can't save the data at this speed using an sd-card. Therefore my plan consists of storing data in RAM. In order to achive this, i must know two things. 1. How great is free Ram? 2. Where does the free RAM begin?

Alternatively: Does anyone know a hardware solution where I can store data in external RAM with above mentioned speed?

Thanks

This is the reference page : http://arduino.cc/en/Main/arduinoBoardDue RAM : "96 KBytes of SRAM" How much data do you want to store ?

To store data in external ram, you need software. That slows it down. http://hackaday.com/2014/04/09/using-simms-to-add-some-extra-ram-on-your-arduino-uno/ http://hackaday.com/2011/09/05/upgrading-ram-in-an-arduino-mega/

There is about 96k available, take out say 6k for heap and stack (depends on your program) so maybe 90k of RAM for general storage.

Is that enough? If not you are sh*t out of luck.

1 Mio samples per second.

For how long? 90k will give you 90mS of storage.

Where does the free RAM begin?

The top of the heap. The actual address is of little use but can be found at run time if you really need to know.


Rob

Following the answers (thanks!) things now appear a little bit clearer to me. My problem is the high amount of storage because the measurement time is about 2-3 minutes. That means the necessity of about 150s*1MB/s=150MB. That's why internal storage is far away from being great enough. Therefore I need external RAM or SSD. Has anyone got experience with connecting SSD and DUE?

I think then the Due is not a sutiable processor for you. As it stands it looks like you would have to use another board like the raspberry Pi running bare metal, not Linux.

This is 8MB of an external RAM easy to connect to DUE (driver available): http://forum.arduino.cc/index.php?topic=220918.0

Measureino: Following the answers (thanks!) things now appear a little bit clearer to me. My problem is the high amount of storage because the measurement time is about 2-3 minutes. That means the necessity of about 150s*1MB/s=150MB. That's why internal storage is far away from being great enough. Therefore I need external RAM or SSD. Has anyone got experience with connecting SSD and DUE?

That is a pretty tough target for a Due. SSDs usually have a PCI or SATA interface, not available on Due. At a pinch you might be able t o use a USB mass storage device, not sure that would give a better performance than SD.

Serial SD is quite slow, the SAM3X has a high-speed SD interface, not used on Due. I have seen it in use on the Duet board though, a Due variant designed for 3D printing. SD cards tend to have long unpredictable pauses anyway because of their onboard controller.

Unfortunately the Due does not bring out the external memory bus on the SAM3X, which would allow easy access to large RAM or Flash.

I think your best bet for a DIY solution with the Due would be an SPI connected NOR Flash, e.g. http://uk.rs-online.com/web/p/flash-memory-chips/8096901/. You will need at least 3 to get 150MB, I would connect 4 and interleave writes so you should be able to achieve 1MB/sec. SPI bus will be a bottleneck I think.

Otherwise you could look at the Duet, it is mostly Arduino compatible. There is nothing else suitable in the Arduino environment I can think of. The boards with big memories (IOW, Linux capable) require some serious bare-metal coding. I know there is some bare-metal stuff for Raspberry Pi, that might be worth looking at.

1MB/sec to write on a sdcard is possible with DUE, imho. You need to buffer the data into an fifo to eliminate the sdcard’s write latency.
That fifo buffering while writing to an sdcard has been discussed dozen times on this forum already.

The chip does have DMA controller, so it ought to be possible to write data to a large RAM buffer in hardware, permitting an SDcard solution on the Duet board perhaps?

pito:
1MB/sec to write on a sdcard is possible with DUE, imho. You need to buffer the data into an fifo to eliminate the sdcard’s write latency.
That fifo buffering while writing to an sdcard has been discussed dozen times on this forum already.

Maybe, but SD cards can pause for long times, 100ms (or longer!) is possible . At 1MB/sec that means buffering up to 100k of data in 96k of RAM…

However, data compression can often cut down the data rate significantly, which might make some things more feasible.