NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.
Everything Else » Adding RAM
October 19, 2012 by Ralphxyz |
A couple of days ago, in the very interesting array limitation thread JimFrederickson said:
Can one add external RAM? How? That would make a great Nerdkits Community Library article. I have a couple of handfulls of old SIMMs. Noter did a great job of describing using I2C EEPROM memory. I2C is a serial protocol how would one be able to access a parallel SIMM? Using I2C for the LCD output (thanks Rick) and other I/O I have 20 pins available for parallel use but is this feasible? And then wouldn't I need a OS or could the compiler be modified to deal with the external RAM? I "think" I can picture accessing external RAM with my Raspberry Pi but that will have a OS (if I ever get round to taking it out of the box). I just can not picture how to access external RAM. Even if one could not get external program memory it would be cool to just have external volatile memory storage for holding variable values. An extra 16/256kb (or more) of external volatile memory might be useful. Thanks, Ralph |
---|---|
October 19, 2012 by Ralphxyz |
Of course using a SD card is using external RAM but I am wondering if anyone knows how to use a old SIMM? Does the SD card use serial communications? Of course I can look at the SD Card Project to get a idea about what the code might look like. Ralph |
October 19, 2012 by JimFrederickson |
Hello Ralph, Of course additional RAM can be added, but the RAM is not going to be like Microcontroller RAM. (It will be accessed MUCH slower, and will need to accessed in some "indirect manner"...) In order to be able to utilize that RAM there would need to be specific routines made to either virtualize a segment of Microcontroller RAM or to provide some indirect access to external RAM. At a minimum the following choices would have to be made:
Mostly though, any external storage is easiest/most effectively used as some sort or Array. Mostly then, it is best to be a log of some sort or a collection of data to be processed later. There are several I2C RAM and EEPROM DIPs that are available that work on 5v. MOST now, and probably soon ALL, will be 3.3v. If you REALLY wanted to be able to utilize external RAM as System RAM then you would need to create a Virtual Processor and use your AVR Microcontroller as a Microcode Engine. With the ATMega168 I have really only found it reasonable to use external RAM/EEPROM as a log. With the ATMega328 and the ATMega644 it makes more sense. You can use the I2C Interface and create an effective Microcontroller LAN! That way you can talk to multiple intelligent unit/peripherals as well as have several I/O pins available. What would you do with the RAM? |
October 19, 2012 by JimFrederickson |
I should have included... Usually when I use external RAM/EEPROM as a log, or even as storage, I just divide it into a few arrays of structures of set sizes... I read in and write out individual array entries. It is a lot more "limiting", but it is also a lot more "manageable with resources available to the Microcontroller too. |
October 20, 2012 by Rick_S |
One other note along with what Jim said. There are AVR's that support external SRAM directly such as the ATMEGA128. If memory serves me correctly you can add up to a 64K SRAM to it and set it up to be active above internal memory all done in hardware. I'm not too sure about compiler support though, I've never tried or needed external RAM. Rick |
Please log in to post a reply.
Did you know that reading a double floating point variable with scanf requires "%lf" for "long float"? Learn more...
|