EmbDev.net

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


von Jonas B. (dr_j0nes)


Rate this post
useful
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
useful
not useful
One description of using external RAM is here:
http://www.nongnu.org/avr-libc/user-manual/malloc.html

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
useful
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
useful
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)

Peter

von Jonas B. (dr_j0nes)


Rate this post
useful
not useful
http://andybrown.me.uk/2011/08/28/512kb-sram-expansion-for-the-arduino-mega-design/

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
Please log in before posting. Registration is free and takes only a minute.
Existing account
Do you have a Google/GoogleMail account? No registration required!
Log in with Google account
No account? Register here.