Extra SRAM for arduino DUE

Hello,

I have created an application, where using an SD-card as data source is not fast enough.

Actually I need to store two integer Arrays in fast accessible memory, that may have an maximum of 10 million entrys…

Currently this is done with the sd-card, but the sd-card is a bit to slow…

The internal SRAM of the arduino due is not big enough - I can assign arrays with max. 10000 entrys, then the program execution is not more stable…

Is there a way to attach external ram to the due?

Kind Regards.

Hi, have you considered this?

Hello,

the problem with that suggested aproch is, that this needs the SPI bus.

But I need the SPI bus for the SD-Card - At runtime I need to transfer the data from the SD-Card to the RAM for faster execution...

The data is G-Code...

So basially what happens is:

1) The SD-Card with G-Code gets inserted to the SD-Shild.

2) The program gets lunched, respectively the G-Code gets interpreted and the stepper engines are driven on the fly (this has bad performance because the SD-Card is to slow...)

As a third step I want to buffer the G-Code first on SRAM (wich I have tested and it works fine), but only for very small projects due to the SRAM limitation on the arduino DUE...

Is it possible to share the SPI bus with the SD-Card? During the buffering phase the SD-Card and the external SRAM would need to be used...

Thx for your help!

Kind Regards.

Well, the SPI bus is a bus! Its designed to be shared between different devices. Normally you would also use other Arduino outputs as select signals for each device connected to the bus.

Paul

There's a thread running at the moment about interfacing to an 8MB (I think) card, have a search for that.

But yes, any number of devices can share an SPI bus, if reading a byte at a time it might get messy if the settings required by them are different (although the Due can have different settings for different CS pins I think), but you could read say 5000 bytes in a block.


Rob

The 8MB ramdisk is also a serial RAM, but with 8bits data width :)

http://forum.arduino.cc/index.php?topic=220918.0 I do not have DUE handy, but based on the numbers I've seen in an another topic on Due's External Memory Bus I guess 10MB/sec is doable. There is a filesystem working on the ramdisk too.

RDisk   DUE
================
D0-D7   D0-D7
NWR NWE
NRD NRD
NDATA   Ax

Thanks Pito, that's the one.

serial RAM, but with 8bits data width

I'll have to think about that :)


Rob

Thx for the great information.

Apparently I tried to avoid the neccesity of using an external RAM.

The problem with the SD-Card is the time it needs to load data blocks - this happens usually each 512 bytes and causes a delay of 500 µS up to 1 ms, dependent which SD-Card I use…

I am feending stepping engines with the information (G-Code like data) that is on the SD-Card.

But the delay of the 1ms, that the SD-Card needs to load a new data block each 512 bytes, is causing vibrations on the hardware construct.

The vibrations causes the system to fail working with high speed.

A test with the G-Code in SRAM had shown, that these vibrations do not occour. → limitated space…

I really dislike to change to another plattform, because I really like the DUE, so I hope I will be able to solve this issue, as I really need the high speed mode…

Kind Regards

The problem with the SD-Card is the time it needs to load data blocks - this happens usually each 512 bytes and causes a delay of 500 µS up to 1 ms, dependent which SD-Card I use...

I would think you could set up a background "task" that fills a FIFO of say 10000 bytes, this should smooth out the data flow.


Rob

Hello Rob,

your idea sounds efficient.

Apparently I am a .net programmer - I am playing with arduino and the C dialekt of it since about 6 months, so I am not highly experienced with it.

Working on a normal computer I would probably create a thread that takes care of the buffering and another thread that utilizes the data by controling the steppers...

But as far as I know the arduino is only capable of running one single thread...

So is it possible to create a "background task", that does the buffering, without interrupting the project execution?

Once I have lunched the execution of the project, each delay will also cause a mechanical delay (steppers) - that has an negative impact...

Thanks,

Andreas

So is it possible to create a "background task",

It should be but I've not done it on an Arduino.

Maybe turn things around and make the sending of chars to the machine the background task, interrupt driven so it never gets blocked, and the main loops polls the buffer and gets another 512 bytes when required.

You could set up a timer to generate the periodic interrupt or use the UART's Tx empty interrupt.


Rob

FRAM - fast, non-volatile and might eliminate the need for an SD card. Haven't checked if a breakout board is available anywhere, but take a look at this thread which includes a library for the Due.

Hey Andreas1984,

I too have this same problem, I am outputing wave forms through an 8 channel DAC, the source of the waveforms are stored in a an SD card. Unfortunately the output is not what is expected as the SD library pulls another 512 byte block every 10ms or so. I need to buffer this somehow, or use another type of external memory. Did you find a solution for your problem?

masterchef: Hey Andreas1984,

I too have this same problem, I am outputing wave forms through an 8 channel DAC, the source of the waveforms are stored in a an SD card. Unfortunately the output is not what is expected as the SD library pulls another 512 byte block every 10ms or so. I need to buffer this somehow, or use another type of external memory. Did you find a solution for your problem?

Why not send this as a PM instead of resurrecting a 4 years old thread?

Advantages of resurrecting old threads-

  1. If my query is answered here, then everyone can see it, the question will never have to be asked again by anybody.

  2. Someone else may have had this problem, and they may be able to help, which is cool. There are lots of cool people like that on this forum. Again, more information is available to other amateurs like myself in the future.

  3. Andreas1984 might not be around this forum anymore, someone might know this and possibly point me in a new direction. So at least then I know I wont be hanging around waiting on a reply from a private message.

Disadvantages of resurrecting old threads-

  1. The old thread might appear on the first page of the forum for a little bit, if it stays on the first page then a duscussion has begun and people learn, which is good. If a discussion doesnt happen, then it will probably wither on down the forum list and disappear again, and since this is a very active forum it would disappear quite quickly.
  1. Same as starting a new thread.
  2. Same as starting a new thread.
  3. Andreas1984 posted 2 days ago.

The main disadvantage of a resurrected thread is that it usually contains a lot of information that doesn't pertain directly to the OP's question, and/or is obsolete.

Thank you for explaining that aarg, I have never thought about it that way before.