Go Down

Topic: SRAM Expansion Shield for Arduino Mega (Read 8063 times) previous topic - next topic

lagrangianpoint.net is pleased to announce the new SRAM Expansion Shield for Arduino Mega.



Have you been developing a project that required a lot of SRAM and blown the heap/stack? Maybe you just to prefer to write applications in C++ and also use the STL ports available out there. Those "unexplained" errors are not easy to debug! This shield could therefore be the solution to your needs.

Features include:

  • 448 kB SRAM available through the Arduino Mega extended digital interface.

  • Based on the design by Andy Brown, supported by the xmem software library.

  • Available in both kit (absolutely everything supplied) and PCB versions.



Check out the product page for more information and how to purchase. There's a Tech Note available explaining some of the background plus links to Andy Brown's original implementation.

K5CZ

I just ordered one piece and already I'm looking forward to it!
Arduino Uno R3, Arduino Mega 2560 R3, Ethermega (R3), and some Ethernet Shields (R3), Chronodots, TMP36 sensors, DS18B20 sensors, LCDs/TFTs, RS232C to learn and play...

robtillaart

Do you have an example how to address this extra memory?

e.g. if I want to fill an array of 65 000 integers with analog samples from analogRead(A0);

Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

CrossRoads

How's that compare to the Rugged Circuits SRAM shields?
http://www.ruggedcircuits.com/html/quadram.html
http://www.ruggedcircuits.com/html/megaram.html
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

sbright33

If you fall... I'll be there for you!
-Floor

Skype Brighteyes3333
(262) 696-9619

K5CZ

#5
Sep 04, 2013, 09:39 pm Last Edit: Sep 07, 2013, 09:13 am by K5CZ Reason: 1

I just ordered one piece and already I'm looking forward to it!

So, my kit is now complete (many thanks to EverMAX s.r.o. for soldering SMD parts!!!) and now comes the time to test the expansion.

*** EDIT ***
But first problem is here:
under IDE 1.5.2 adding
#include "xmem.h"
causes multiple definition of `malloc'
As a beginner I am not able to solve this problem.

*** under IDE 1.0.5, 1.5.3 and 1.5.4 compilation passes without errors ***

And second question is:
how to print current size of unused memory (free space for call stack and free space for heap)

And last question is:
Calling xmem::begin(true); allocates memory like that?


Arduino Uno R3, Arduino Mega 2560 R3, Ethermega (R3), and some Ethernet Shields (R3), Chronodots, TMP36 sensors, DS18B20 sensors, LCDs/TFTs, RS232C to learn and play...

K5CZ

Arduino Uno R3, Arduino Mega 2560 R3, Ethermega (R3), and some Ethernet Shields (R3), Chronodots, TMP36 sensors, DS18B20 sensors, LCDs/TFTs, RS232C to learn and play...

pito

There is a functionality in at least 1 compiler I am aware of called "addressmod"
Quote
Part of the IEEE Embedded C standard (ISO/IEC TR 18037), addressmod allows you to create custom qualifiers to create variables in any kind of memory device. The identifier can be used with any data types, including structures, unions, arrays, and pointers.

Maybe some compiler experts/gurus may implement that into the compiler, so we can use an external memory space fully transparently within the C code then.

MichaelMeissner


There is a functionality in at least 1 compiler I am aware of called "addressmod"
Quote
Part of the IEEE Embedded C standard (ISO/IEC TR 18037), addressmod allows you to create custom qualifiers to create variables in any kind of memory device. The identifier can be used with any data types, including structures, unions, arrays, and pointers.

Maybe some compiler experts/gurus may implement that into the compiler, so we can use an external memory space fully transparently within the C code then.

Infrastructure done.  :) ]:)

Well, I and two other people implemented the machine independent support in the GCC 4.5 time frame for the Cell processor. Shortly afterwards the AVR compiler switched to use it for PROGMEM.  I imagine if the AVR developer has the cycles to do it, it could be added for the external SRAM.

Of course given, the compiler shipped with current Arduino IDE's is still 4.3.2, it is kind of a moot point for most Arduino users.

pito

#9
Nov 13, 2013, 08:15 pm Last Edit: Nov 13, 2013, 08:19 pm by pito Reason: 1
Interesting! For example the compiler I know does it in following manner (or it claims it works such way):
Code: [Select]
..
_read - an user defined function for reading n-bytes from an external memory
_write - an user defined function for writing n-bytes into an external memory
..
addressmod(MY_EXT_RAM, _read, _write, 0x000000, 0x3FFFFF);
..
MY_EXT_RAM  long my_array_1[30000];
MY_EXT_RAM  char my_array_2[100000];
MY_EXT_RAM  float x,y,z;
..

I did some simple tests in past (with an external SPI FRAM) and it worked somehow. The var access times depend on _read/_write functions to the hw  (ie. SPI, or bitbanging, etc..).


Does anyone know of any Mega2560 RAM expansion boards still available,  both the rugged circuits board ("on backorder indefinitely") and the lagrangianpoint.net board ("out of stock")  are currently unavailable. 

I'm looking for  a small number to boards (<10) and just need around 64K, but will take bigger ones if need be.  I guess failing that, i'll do a bit of a re-write and port to the Due...


MarkB

Go Up