EmbDev.net

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


Author: Jonas B. (dr_j0nes)
Posted on:

Rate this post
0 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
Author: Carl D. (Guest)
Posted on:

Rate this post
0 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 ;-)

Author: Jonas B. (dr_j0nes)
Posted on:

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

Author: Peter (Guest)
Posted on:

Rate this post
0 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

Author: Jonas B. (dr_j0nes)
Posted on:

Rate this post
0 useful
not useful
http://andybrown.me.uk/2011/08/28/512kb-sram-expan...

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

Reply

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]
  • [avrasm]AVR assembler code[/avrasm]
  • [code]code in other languages, ASCII drawings[/code]
  • [math]formula (LaTeX syntax)[/math]




Bild automatisch verkleinern, falls nötig