Do I really need that much RAM?

I just recently retired & I want to take up electronics as a hobby. I'm a newbie.

Most of the Arduinos have either 16KB or 32 KB of RAM.

I haven't gotten an Arduino yet. I'm leaning towards the Mega 2560. I was thinking about it today & I wondered if I really need 256 KB of RAM in the Mega2560. Since I'm an absolute electronics beginner, I'll have to start simple. Ultimately, I'd like to make an RGB LED matrix. I've seen some pretty amazing RGB LED cubes on YouTube. I don't know which Arduino is used, but it seems to me that I'd probably never use 256 KB of RAM. I don't know how much RAM is needed to do the incredible displays for the RGB LED cubes. It also seems to me that 16 KB or 32 KB would limit one to simple programs. Actually, less than 16 KB or 32 KB because some of that is used for the bootloader.

So, is 256 KB of RAM overkill? Can you give an example of a program that would use 256 KB of RAM? If a compiled program is over 16 KB or 32 KB, I suppose that the IDE will warn the programmer that the maximum amount of memory has been exceeded. In which case, the programmer will have to trim the program somehow. I'd rather have an Arduino with 32 KB of RAM than one with 16 KB of RAM.

'328P Arduinos have 2K SRAM. There is 32K Flash memory.
2560 Arduinos have 8K SRAM. There is 256K flash.
1284P Arduino-compatibles (like my boards) have 16K SRAM. There is 128K flash.

SRAM is needed when you have a lot of data that the sketch needs to manipulate. For example, the data was coming in from the serial interface somehow.
Flash is where the program being run is located. If you have fixed patterns being displayed, they can be programmed into flash and just called up by the program.

I suspect that many amazing RGB displays are getting data from external sources.

Running out of SRAM is more common then running out of FLASH in most of the projects we see here. That aside starting with the basic Uno board is the best entry point and recommended by most when first starting with arduino. As you gain knowledge and experience you will know when to consider bigger chips to support a specific project.

CrossRoads:
SRAM is needed when you have a lot of data that the sketch needs to manipulate.

At least, to manipulate at once. You can data through an UNO like something through a tin horn.

For example, the data was coming in from the serial interface somehow.

If you go the "buffer then process" route. With a good state machine you don't.

Flash is where the program being run is located. If you have fixed patterns being displayed, they can be programmed into flash and just called up by the program.

It's a good place to keep patterns you want to match in incoming data regardless of how.
It's good for tables that save on calculations and time, I showed an example of a 100x speed-up sine table.
It's good for all the constant text labels and messages you want to see that would otherwise fill RAM.

I suspect that many amazing RGB displays are getting data from external sources.

You're counting SD cards connected right to the Arduino, aren't you?
SD can be a kind of Arduino hard drive, but needs to be treated a bit differently.
Don't sort on SD like you would on a HD, generate a link file instead. SD is write limited, HD is practically not.

I was thinking more a PC, processing video and sending it to Arduino for display. Pre-defined patterns from SD would also work.

CrossRoads:
I was thinking more a PC, processing video and sending it to Arduino for display. Pre-defined patterns from SD would also work.

I was like "huh, Arduino can't handle video" before I remembered these new models, Due, Yun and Galileo.
Or do you mean real low res "video"?

I know that Arduino can stream MP3 data to a sound chip and do sort of audio without one.

With a Teensy or probably a Leo you get direct USB data speed from a host. Data faster than 16MHz can use.

But I was thinking more of text/data processing. Big RAM usually makes that easier (for some things, possible) and faster but a lot can be done working from files if you have the time. Long ago there wasn't any choice so we had to use techniques that seem mostly forgotten since the 80's. I feel the same about integer math vs floats.

Yes, low res, like patterns to display on an LED cube.
The most I've written code for is sending out 325 groups of 45 bytes from SRAM in response to a 20 KHz trigger. (45 bytes every 50uS, 325 groups from '1284P SRAM memory).

I'm working on some code next for a 9x9x9 cube.
Figure I'll store the data as 9 integers per layer, x 9 layers and somehow put 9 bits from each int into 11 bytes to send out via SPI every 3700uS for a 30Hz refresh rate. (1/30 / 9 layers).
The 9 ints lets me picture each layer as 9x9 grid for data manipulation.
Then my cube can be 9 ints x 9 layers in memory, so 162 bytes per cube pattern.
In a 1284, I can then have 90 patterns, and my starting code can simply be 90 cube patterns that I move between.
Have not written code for a cube before, so manipulating the data on the fly for rotating effects is beyond what I think I can at the moment.
We've got the first 3 layers soldered up, but not to each other yet.
Bottom layer is mostly secured to the display board - perfboard strips still needs to be secured (need a bunch of short panhead screws), and leads attached to bring the 81 LEDs to the control board. Gonna use male pin terminated wires from Pololu, female headers on the control board, so we can swap things around as we figure out what we're doing. And then some holes drilled for the cathode layer wires to go thru.

I just recently retired & I want to take up electronics as a hobby. I'm a newbie.

Congratulations.
You are going to have a lot of fun.

I'm leaning towards the Mega 2560

If you can afford it, I recommend you learn on an UNO, then move up to something bigger as you learn more.
Next get a Bobuino and maybe 2560 as you get more familiar with hardware.
It's nice to have the ability to replace the controller if you mess up as you can with the UNO and the Bobuino.
Take a look at Nick Gammon's web site for great information on programming and hardware.

Bobuino's here, I offer them as kits or assembled boards.
http://www.crossroadsfencing.com/BobuinoRev17/

Macnerd:
I just recently retired & I want to take up electronics as a hobby. I'm a newbie.

Since I'm an absolute electronics beginner, I'll have to start simple.

Have you written code before?
And C code in particular?

There's the hardware side and the software side, and usually people head more strongly into one than the other.
Generally though you can cookbook one or both as you learn, sticking to recipes where you're not familiar.

More or less retired here too but I did so much software before I have a big head start.

Have you written code before?
And C code in particular?
I come from a Windows world, but last year I bought a Mac mini & MacBookPro. I've played around with classic BASIC & Visual Basic.NET(didn't like that). I've also played around with Java & I want to learn Javascript. I've seen some pretty neat 3D Javascript examples that I want to learn how to do. Since I have a Mac I might learn XCode which is basically C.

I'll have to check out the Bobuino.

32k on a "328" type arduino such as a nano v.3 is enough for it to upload more program than compiles from 10+ pages of source code c (which being edited on your pc or other external device can be typically >50kb in notepad)

I don't know if you remember the BBC micro. That had 32k total.
Also, it had "himem" and "lowmem" places to keep the basic editor separate from the compiled running instruction.
Arduino does not have flexibility to move that boundary.
32k is the size of "program memory" to contain the binary compiled on your pc and uploaded to it.
That tends to be about as compact as the proffessionally compacted assembler of a game on a BBC micro.
Think "Repton" or "Elite" for how much information that can hold.

Also note the size of "SRAM" data memory on the arduino, which is a separate section of the chip, for which you cannot just move a "Highmem" partitionmarker like on the beeb. On my "328" that is 2kb SRAM, and I keep a careful watch on it during development using functions copied from (look up memoryFree() ). SRAM is where you store normal data in use in your program, and I try quite hard to keep that as small as sensible, to leave more room for future additions. Also I'm curious about that. Just the library to use Serial.print and libraries to display to an lcd screen can fill 500bytes before you have started programming anything much. Still, it is a lot better than making room for BBC Mode 2 Graphics, if you remember that.

You probably wont use EEPROM, which is as good as having a built-in tape drive as a system-on-a-chip. That has 1k of capacity, and for example can hold your "if lost, please return to" message, calibration constants of any sensors which you have made, and stuff like that to be accessed very occasionally.

So, your thoughts about memory are I think, about right. The unit which you were thinking of getting is indeed way overkill for many applications. Depending on what uses you have for it, you might find a "328" based arduino to be about right for quite a lot of things. And they are so cheap that you can always buy an extra nano v.3, a bit of pinboard, a bag of LED's, assorded resistors (I find 10k to be the single most used value), and some bits of single strand wire. I quite like 2N7000 nfet because those switch cleanly a fair lot of mA from a 10k resistor from arduino digital_out to gate.

For your particular choice of writing to an LED array, I am confident that a "328" arduino is plenty.
You'd have enough to write your "Hello Macnerd" to an lcd too, if you got one and figured out how to make libraries findable to your IDE.
SRAM of up to 2k, being cautious knock off 1k for diagnostic program messages and extra bits, could leave you with at last a k.
Being sensible about bitpacking, for example using digitalWrite(  (bytestore[x][y]>>z)&1  ) it has about enough room for 32x32x8 led states max.
Your decision depends on whether that is enough.

I also have a "168" based smaller original arduino, presently monitoring a few battery and solar panel voltages.
You don't need to go that small in 2014.

Macnerd:
Have you written code before?
And C code in particular?
I come from a Windows world, but last year I bought a Mac mini & MacBookPro. I've played around with classic BASIC & Visual Basic.NET(didn't like that). I've also played around with Java & I want to learn Javascript. I've seen some pretty neat 3D Javascript examples that I want to learn how to do. Since I have a Mac I might learn XCode which is basically C.

This is good news though my condolences on coming from Windoze World. ;^)

The good news is that you probably have the most basic ideas down and are to some degree code literate.

Arduino IDE is AVR Gnu C++ based.
The Arduino Reference page has a link to AVR LibC, the standard library reference.

http://www.nongnu.org/avr-libc/user-manual/modules.html

You might want to surf the Arduino Main Site and bookmark the major pages; Reference, Libraries, Examples, AVR LibC and The Playground. Have a look at the Fundamentals page, you may want to mark that and Hacking as well.
The Products section has semi-complete info on each different board, you can find it from other pages.

Writing some Arduino code, I keep a browser tab open to the Reference and open more as needed.
My browser lets me zoom pages which makes referring to it a lot easier than reading book text. XD

I have a magnifier visor from Harbor Freight that has a box with 4 different lens sets. I don't see it on their web site but they do have 3x glasses clip-ons that I'm wanting to try. I like the visor I have though. I can switch the magnification and distance the lenses are from my eyes for detail and field of depth. When I'm trying to poke jumpers into the right hole, etc, I need that stuff.

I have a magnifier visor from Harbor Freight that has a box with 4 different lens sets. I don't see it on their web site but they do have 3x glasses clip-ons that I'm wanting to try. I like the visor I have though. I can switch the magnification and distance the lenses are from my eyes for detail and field of depth. When I'm trying to poke jumpers into the right hole, etc, I need that stuff.
That's something that I need. I just retired & my eyesight isn't as good as it used to be. I have progressive bifocals, but I take my glasses off to read. I went to the Harbor Freight website & looked at the magnifiers. I also looked at the storage & organizers. Whatever Arduino I decide to get, I need something to store it in along with a wall wart(s) & a battery holder(s) & solderless breadboard(s) & tools & components. So, I plan to go to Lowe's & Home Depot & Harbor Freight & look at their organizers & toolboxes. I need to get that before I buy the Arduino.

Naw man, you can "live" out of cardboard boxes and little bags of resistors for the first projects.
Don't spend even moderately big until you have progressed beyond the small, unless you want to waste money.

It's easier to approach a small task when you're just a beginner. If you commit big before you start then whenever you go to do something, it will have to be enough to justify the big. For a beginner, that's like learning to walk and push a car at the same time.

In your IDE, in the File Menu is Examples with a bunch of categories. You want to go through 1,2,3 and 5.
Skip 4 because it teaches C++ String objects that really do not belong in small environments even though some people seem to think so. Learning to rely on those, few take the time to learn C string char arrays and functions.

Maybe go through 5 before 2 and 3. I dunno, 5 has arrays, loops and logic examples.
Of course what you already know, you can brush up or skip but just the practice and getting used to the IDE and board can do a lot of good.

If you need help with C strings then just sing out. The usual hidden problem is not knowing how the arrays work, real ABC level literacy by the way, and then how the functions can be arranged logically. With that knowledge, C strings make sense and give you complete control. You can even get away without using the functions, but generally people learn and use them before understanding that if they ever do.

I don't use functions. Just write everything inline, most things people write as functions are just a waste of time in my opinion.
I do get function-like functionality. I'll have several pieces of code doing their thing, say a, b, and c. A might be checking time blink-without-delay style, b could be checking serial data coming in, and c could be controlling multiplexing of a display.
So loop basically breaks down to:
if ('a' condition met){ do something, may include updatig data and setting a flag for 'c' code}
if ('b' condition met){ do something, may include updating data and setting a flag for 'a' code}
if ('c' condition met){ do something, such as clear the flag and update the display}

No jumping back & forth from little chunks of function code.
Just checking 3-4 if conditions that most of the time are not met.

You can make a "function" that doesn't use the stack, if you're obsessed with hiding details:

inline void hideMe( )
{
// whatever
}

And even then, you can butt heads with the compiler:
http://forum.arduino.cc/index.php?topic=191390.15

The best way to tuck code away is to write it into a Class, which I won't go into except that it's really cool.

Too much messing around for me.
Write everyihing out inline so I can see what it's doing without jumping all thru the sketch trying to find something. I believe better performance too since the execution is not jumping back & forth off the stack/heap/whatever.
I'l even turn off interrupts if I want something to happen really fast and not have micros() interrupt getting in the way in its 4uS chunks of execution time. That's how I was able to blast out 45 bytes over 8 MHz SPI in just over 47uS:
45 lines of this:
spdr = array[0]; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
spdr = array[1]; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
:
:
spdr = array[43]; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
spdr = array[44]; nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;nop;
(Thanks to Nick Gammon for showing me how to do that;
needs #include <asm.h> at the top of the sketch - I need to check on the exact format)
17 clocks per line, just over 1uS each: 1.0625uS verifief with a logic analyzer.
47.8uS

What can I say? You've seen my example sketches. XD

But those are trivial code. At some point, even I start with the functions and Classes.

For prototyping and playing around I find the Teensy boards very useful.
https://www.pjrc.com/teensy/

The nice thing about Teensy boards is that they are breadboard friendly
as you can plug them into a breadboard and wire up everything.

For a 3v devices and a big jump in speed and RAM you can get the Teensy 3.1
Teensy 3.1 is ARM based vs AVR based.

One really nice thing about the ARM and PIC332 based products is you don't have to
deal with the AVR PROGMEM issues for your constant data.
With ARM and PIC32 processors, you can simply use C/C++ as the language was
designed and declare you data as const and directly access it.
With AVR you have use the PROGMEM declarations and access routines which
is proprietary to AVR, and complicates the coding.

For 3.3v work, I'd definitely go with the Teensy 3.1 as that drives signals at
3.3v but is 5v tolerant, which is big plus since it allows you play with both
3v and 5v components.

-- bill