Forum: µC & Digital Electronics Link External RAM Arduino Mega 2560 (with Arduino IDE?)

von Jonas B. (dr_j0nes)

Rate this post
not useful
Hey Volks!
I have expanded the RAM from my Arduino Mega 2560 from 8 to 40kb with an 
32kb SRAM.
I have set the XMEM Registers in the program and edited the boards.txt 
from the arduino ide so that the max memory is now 40kb.

I want to use the arduino ide and as a test I declared an int array with 
the size of 16000. I put the index as the data for each array element. 
In the last step I iterate with a for loop thru the array and send the 
data of the elements via serial to the arduino ide terminal.

Nearly all the results in the teminal look like expexted but around the 
adresses of the end of the internal RAM the data in the array just give 
out random numbers.

I think its because i just expanded the memory size in the Arduino 
boards.txt from 8 to 40kb. It seems that the mcu reserves the stack as 
normal variable space.

Does somebody get what i did wrong or how i can link the external memory 
in the arduino ide properly?

Thank you for your time!! :)

: Edited by User
von Carl D. (Guest)

Rate this post
not useful
One description of using external RAM is here:

If you want total flexibility, you need to learn about linker scripts.
Together with section-attributes On variables, you can control what Gose 
where. But not typically Arduino, but, you already attached external 
memory, so you are Not a newby ;-)

Sorry for spelling, but iPad likes TO write German ;-)

von Jonas B. (dr_j0nes)

Rate this post
not useful
Thank you I will have a look at the site.
Yeah i am also German so no problem ;)
Thank you! :)

von Peter (Guest)

Rate this post
not useful
I really would like to understand and see how such thing like ram 
expansion can be done. Maybe when time allows you can show details with 
pictures and explanations...

(I dont mean spi ram or similiar)


von Jonas B. (dr_j0nes)

Rate this post
not useful

This Tutorial gave me a very good entry point. The RAM from the mega 
2560 can easily be expanded (up to 64kb) with an SRAM chip and an octal 
tri state latch with d-latch in it.

In the Tutorial is everything mentioned what you need to expand the RAM 
except of setting the registers for letting the MCU know what you are 
doing ;) this can be read in the official documentations of the Mega 
2560. The linker stuff is also not mentioned in the Tutorial ^^ Thats 
why I was asking here ;)

Have fun Peter! :)

: Edited by User


Entering an e-mail address is optional. If you want to receive reply notifications by e-mail, please log in.

Rules — please read before posting

  • Post long source code as attachment, not in the text
  • Posting advertisements is forbidden.

Formatting options

  • [c]C code[/c]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]

Bild automatisch verkleinern, falls nötig
Note: the original post is older than 6 months. Please don't ask any new questions in this thread, but start a new one.