Take the 2-minute tour ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.

I know that it is possible to write data in ROM(Read Only Memory).
But what about if I want to write data in RAM(Random Access Memory)?
Can I do it using "Arduino Uno R3"?
RAM is normally associated with volatile types of memory.

There are several examples about writing data in EEPROM as in a (Read Only Memory) which may have 8 pins.
In order to store values read from analog input 0 into the EEPROM we need to use the "EEPROM.write()" function.
These values will stay in the EEPROM when the board is turned off and may be retrieved later by another sketch.
ROM is a Non-volatile type memory.
SD card is also Non-volatile type of memory.
We know that there are few SD card shields for "Arduino Uno" and it is possible create your own shields.

But what about volatile types of memory?
what about if I want to write data in RAM like a "DDR SDRAM" or in a DDR3 memory which may have 240 pins instead of 8 pins?
So my question is is it possible to write data in "DDR SDRAM" using "Arduiono Uno R3"?
How? Where should I connect those 240 pins?

share|improve this question
    
What is your eventual goal? What do you want to do with DDR3 that you couldn't accomplish with SRAM? Or with an SD card if you need a large storage? –  JRobert Jun 6 at 11:43
    
I think the OP wants to write to external memory (not the onboard RAM). @IremadzeArchil19910311 - please specify what sort of RAM you have in mind (part number). 240 pins? I hope you are joking. There are not 240 I/O ports on the Arduino. These are designed to plug into a PC or Mac. You can however get SPI or I2C RAM modules. –  Nick Gammon Jul 6 at 10:45
    
"So can any kind of SDRAM Shield help me to solve this problem?" You've only asked about a solution - DRAM - and haven't yet explained the problem you're trying to solve. If you could have DRAM, what would you do with it? Must it be DRAM or can you accept alternate ways to accomplish your goal? –  JRobert Jul 6 at 11:32
    
Even in the rare situations where external RAM could be remotely sensible, you are probably better off using SRAM than any flavor of DRAM like DDR, SDRAM, etc, as you are unlikely to use enough of it for the greater complexity of dynamic RAM over static RAM to be justified by the lower cost-per-bit. But really, for anything requiring this scale of memory, you should move beyond the Arduino to a more appropriate platform first. –  Chris Stratton Jul 6 at 22:29

2 Answers 2

Your program is already using the on board RAM:

int a = 5; // This is RAM. Where did you think it goes?

DDR3 RAMs require (typically) 1633 MHz clocks, and store gigabytes of data, not something you use with Arduino, which has a 16 MHz CPU.

If you need EXTRA (emphasis on extra) RAM, my first advice would be to refactor your project, and reduce processing on Arduino.

However, if must have more RAM, get SRAM. In most cases, DDR3 trade high maintenance for cost. Have a look here.

share|improve this answer
    
int a = 5; is in RAM only if declared at global scope. If it's a local variable, it is almost certainly assigned to CPU registers. There are exceptions though: if you take the address of the variable, or if there are not enough available registers, it will end in RAM, but this is uncommon. –  Edgar Bonet Jun 6 at 10:18
    
How about recursion. This will almost certainly use stack, in memory. –  prakharsingh95 Jun 6 at 10:28
    
Even with recursion, the variable is likely to be assigned to a register while “live”, and saved on the stack only for the duration of the recursive call. This may depend on how much use the variable has though, so you should disassemble if you want to know for sure for some particular recursive function. –  Edgar Bonet Jun 6 at 11:15

DRAM of any kind requires a memory controller which is not present in any AVR device. Larger AVR devices such as the ATmega64A and ATmega128A do have an external memory bus that can be used for SRAM and MMIO.

share|improve this answer
    
So can any kind of SDRAM Shield help me to solve this problem? Do SDRAM Shields have this memory controller? –  IremadzeArchil19910311 Jun 5 at 17:02
    
The Uno R3 does not have an external memory bus regardless. And performing MMIO to access paged DRAM will be painful at best. –  Ignacio Vazquez-Abrams Jun 5 at 17:06
    
In short, the Uno (or rather, the ATmega328) simply isn't designed for that kind of application. The new Zero might, with it's Cortex M0+ processor. Don't quote me on that, though... –  CharlieHanson Jun 5 at 17:59
    
The memory controller wouldn't be integrated into the core, so it would depend on which specific chip or family it uses. The SAM-D21 (Zero) doesn't have an external memory bus. The SAM3X8E (Due) has an external memory bus but no memory controller and doesn't seem to expose the entire bus via headers. The Sitara 335X (Tre) does have a memory controller, but it is only connected to the on-board DRAM. –  Ignacio Vazquez-Abrams Jun 5 at 19:03
    
OK! But what about "Arduino Mega"? Or what about "Arduino Due" which is an ARM device? –  IremadzeArchil19910311 Jun 6 at 7:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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