20
\$\begingroup\$

I have two leftover 2GB RAM modules that I removed from my MacBook Pro when doing an upgrade. I was just wondering if these were usable with, for example, an Arduino. I'd be too much of a beginner to actually try to do this now anyway, but I'm curious if it is at all possible, or if that's just way too much memory for a microcontroller to address.

\$\endgroup\$
  • 1
    \$\begingroup\$ you could probably rig something to do it, but the interface circuitry would probably be the most complex part of the resulting system, and there'd be little practical value in the result. \$\endgroup\$ – JustJeff May 4 '11 at 1:57
  • \$\begingroup\$ Thanks for the great answers! Very interesting. I'm gradually learning about how the pieces fit together. Thanks. \$\endgroup\$ – johndeo May 5 '11 at 23:09
  • \$\begingroup\$ ARM9 and ARM11 platforms host DDR2 controllers, but then you're not talking about microcontrollers but about microproccesors. FPGA can interface with it as well. The whole task is quite complex. An arduino is only 8-bit, so it just can't do the massive addressing job in hand. \$\endgroup\$ – Hans May 9 '11 at 6:59
  • \$\begingroup\$ What Hans said - any micro sufficiently powerful to make use of that kind of RAM will have a DDR controller built in. I've not looked closely at the inner workings of DDR control, but the fact you need dedicated hardware to do it tells you something... older modules, stuff from old laser printers etc. might be more usable. \$\endgroup\$ – John U Nov 22 '13 at 9:17
24
\$\begingroup\$

I'm going to say no: the most basic incompatibility is that there's way too many pins on those modules even be able to interface it physically to an Arduino. Ditto for similar small microcontrollers. An ARM Cortex M3 is getting closer, but few of those actually have the external bus necessary to interface RAM in such a fashion (I think).

But I'll play along an go further. Assuming you could interface the chip to the Arduino somehow another basic electrical compatibility problem is the voltages required. I think these RAM modules use something odd like 2.2V - not present on a vanilla Arduino board or really, any other basic hobbyist microcontroller.

Assuming that was taken care of then the chip would pretty much work like any other external memory to the Arduino. This is really done all the time - people add external EEPROM to store important constants or SD/MMC cards for storage of webserver logs and such. Of course, within this context the RAM modules presents no real benefit to the Arduino. Its main feature is speed and the Arduino (and yes, other hobbyist microcontrolers) typically don't break 25MHz in clock speed. They're too slow to care about speed. And storage size isn't a big issue since interfacing to an SD/MMC card is distinctly easier and provides as much space to play with.

So even if it were possible it wouldn't really be advisable.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ have to confess i've thought about interfacing some old DIP DRAM to my arduino, just fer larfs. (but, that'd be doable, on a breadboard even, w/4164 era junk). otherise, i totally agree. \$\endgroup\$ – JustJeff May 4 '11 at 2:04
  • 1
    \$\begingroup\$ That's a quality answer, using step by step assumptions and arriving at the end condition. Nice job! \$\endgroup\$ – LeanerRocky May 4 '11 at 4:17
  • 2
    \$\begingroup\$ Don't overlook the refresh issues. Another reason "command based" flash is probably a better match when a mouse of a controller is trying to drive a mack truck of a memory. \$\endgroup\$ – Chris Stratton May 4 '11 at 19:57
  • \$\begingroup\$ I put a comment above, with the question, but I guess I should really put it here. Thank you so much for the answer. Stack exchange is a super resource, and it's all because of people taking time to provide quality answers. \$\endgroup\$ – johndeo May 5 '11 at 23:12
8
\$\begingroup\$

I would say no, not without sticking a good sized (pin count) fpga in between, the fpga talks to the memory and the microcontroller talks to the fpga using a paging scheme.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ My thought as well. And have the FPGA be a transparent refresh controller. But really... wouldn't it be simpler and cheaper to emulate an arduino in software on a small ARM system? \$\endgroup\$ – Chris Stratton May 4 '11 at 19:54
  • 1
    \$\begingroup\$ However fun or educational it might be DDR is not simple, and not beginner stuff. Find another laptop or motherboard to put this memory in and learn about DDR using say an fpga eval board that has a little bit on the side or maybe a beagleboard or something like that. The first problem is pin count, second is the signals, timing, etc. It is hard to get it to work when you make your own pcboard. It is not like an lcd interface or something like that that you can breadboard to a microcontroller. \$\endgroup\$ – old_timer May 4 '11 at 21:46
7
\$\begingroup\$

You could conceivably use a system of latches to allow something like an arduino to generate 32 bits of address, and you could probably devise some scheme to generate the refresh cycles, but there'd be almost no point in doing so, except as a technical exercise.

The interface circuitry would probably be the most complex part of the resulting system, and there'd be little practical value in the result; the arduino would not be able to execute code out of the RAM, the storage would be volatile, and would probably consume more power than the arduino as well. If you want to store data, an SPI EEPROM is probably a much better solution.

| improve this answer | |
\$\endgroup\$
  • 1
    \$\begingroup\$ Can an AVR execute code from RAM in any circumstances? \$\endgroup\$ – Nick T May 4 '11 at 3:33
  • \$\begingroup\$ @Nick T - I was not indirectly suggesting that there are any such scenarios where it could; I was directly saying that in case someone was thinking of interfacing to this kind of RAM, it would be mistaken to think they could use it thus. \$\endgroup\$ – JustJeff May 4 '11 at 11:24
  • 1
    \$\begingroup\$ Serial Flash or SRAM are usually a good deal quicker than EEPROM. If you need lots of nonvolatile data (the remote code use case), Flash is probably the better choice. For large buffers, use SRAM; it's much faster than EEPROM. If you have a few configuration bits that need to be toggled independently, that's really the only niche left for EEPROMs. \$\endgroup\$ – Kevin Vermeer May 9 '11 at 17:19
  • \$\begingroup\$ @reemrevnivek - good point, I +1 your comment. If you're keeping a few dozen configuration settings around, EEPROM. If you want to keep frames of video, SRAM. \$\endgroup\$ – JustJeff May 10 '11 at 1:51
7
\$\begingroup\$

If you ever look at DRAM chip datasheets there's a minimum clock speed of something like 50MHz+ for DDR2. So no, you will not be able to interface with them with a microcontroller (unless it has built-in hardware support).

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ Not to mention that you need to refresh the memory rather frequently as well! The Arduino would be busy spending all its time driving the memory control lines! \$\endgroup\$ – Toybuilder May 9 '11 at 23:57
6
\$\begingroup\$

The short answer is no.

The Arduino can't drive the DDR or DDR2 memory interface. You could make a DDR/DDR2 controller with a SPI interface with an FPGA, but that's a significant undertaking.

| improve this answer | |
\$\endgroup\$
6
\$\begingroup\$

You'd need a low voltage driver (SSTL), and some way to control about 100 channels (each differential, so about 200 pins. Think BGA.)

Most DRAM has to be refreshed at at least 1kHz and probably more to have a low bit error rate. This will then form a major background task and use up most of the prcoessing power of the Arduino, if it's even possible to refresh memory at such a rate.

What you can look at though is with some microcontrollers, e.g. PIC24F/H/dsPIC33F, they support a parallel master bus interface, which allows some types of parallel SRAM to be accessed. There's even support with C, as this external memory can be mapped onto several in code variables and even blocks which combine both internal and external memories. The external memory requires you to write some PMB code. You'd only be able to address up to about 1 MB with this though.

| improve this answer | |
\$\endgroup\$
  • \$\begingroup\$ AFAIK DDR uses SSTL not LVDS \$\endgroup\$ – mazurnification May 5 '11 at 19:06
  • \$\begingroup\$ @mazurnification, Yeah, you're correct (my error.) Still, a nightmare to control from an Arduino. \$\endgroup\$ – Thomas O May 5 '11 at 19:59
  • \$\begingroup\$ Then correct your answer! \$\endgroup\$ – Kevin Vermeer May 9 '11 at 17:15
  • \$\begingroup\$ @reemrevnivek, okay. Corrected. However, I was merely pointing out that it was impractical. No matter which signalling format is used. \$\endgroup\$ – Thomas O May 9 '11 at 17:24
2
\$\begingroup\$

No, not without a paging interface of some kind between the memory and the MCU. Some of the AVR MCUs do in fact have a built-in external-memory interface - Atmega2560, for example (see section 8 of the ATmega640/1280/1281/2560/2561 data sheet). But the address space is measured in Kilobytes, not Gigabytes.

| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.