Arduino clones with more RAM than Uno?

I have no experience with other Arduino clones other than UNO R2/R3 and Hackduino which I made with atmega328p. Problem is my latest project (LED clock with Wave Shield) needs more than 2K RAM that UNO provides... I'm looking for cheap alternatives. Mega is way too expensive (I actually ordered one to test out) and I plan eventually to make these so I'd prefer to have DIP chips for easier soldering. I've seen some clones like Sagduino, Teensy and ChipKit, but I don't know how compatible they are with current IDE and libraries (I use a lot of advanced things, like EEPROM, fastWrite, etc.) and have no experience with these. What would you recommend? I think I need at least 4K of RAM, and same amount (or little more) of I/O ports as in UNO.
Any advise would be appreciated! :slight_smile:

  • More than 4K of SRAM
  • More pins (I/O) than atmega328p
  • DIP package
  • Support in the IDE and libraries etc..

====== Atmega644p or Atmega1284p... Here is a datasheet for the atmega1284p http://www.atmel.com/Images/doc8059.pdf. 644p and 1284p are essentially the same, just different flash/SRAM size.

And here is the core/bootloader for the 1284p "family". GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino

Are you certain you need more than 2K of RAM? Have you used all the usual tricks of storing constants (including audio files) in PROGMEM?

dc42:
Are you certain you need more than 2K of RAM? Have you used all the usual tricks of storing constants (including audio files) in PROGMEM?

Yup, I'm storing all font arrays in Progmem. Audio is on SD card and I'm using Adafruit's wave library, I'm not sure if that data can be stored it Eprom...

baselsw:

  • More than 4K of SRAM
  • More pins (I/O) than atmega328p
  • DIP package
  • Support in the IDE and libraries etc..

====== Atmega644p or Atmega1284p... Here is a datasheet for the atmega1284p http://www.atmel.com/Images/doc8059.pdf. 644p and 1284p are essentially the same, just different flash/SRAM size.

And here is the core/bootloader for the 1284p "family". GitHub - maniacbug/mighty-1284p: Mighty 1284P Platform for Arduino

Awesome! I'll check it, thank you so much!

bratan:

dc42:
Are you certain you need more than 2K of RAM? Have you used all the usual tricks of storing constants (including audio files) in PROGMEM?

Yup, I'm storing all font arrays in Progmem. Audio is on SD card and I'm using Adafruit's wave library, I'm not sure if that data can be stored it Eprom...

SD card is fine for storing the audio. But the Adafruit doc says the library for that wave shield needs around 600 bytes. So I'm puzzled that 2K isn't enough. Are you certain you have all of the actual font arrays in PROGMEM, not just some top-level pointers to them? Or are you knowingly using a lot of RAM for something else?

dc42:
SD card is fine for storing the audio. But the Adafruit doc says the library for that wave shield needs around 600 bytes. So I'm puzzled that 2K isn't enough. Are you certain you have all of the actual font arrays in PROGMEM, not just some top-level pointers to them? Or are you knowingly using a lot of RAM for something else?

Thanks, I was looking how much ram it needs, and couldn't find it..
You are right, I probably need to find what hogs all the RAM in the my sketch. I'm using a lot of different libraries (HT1632,stdio,Time,DS1307,stdlib.h,WaveUtil,WaveHC) might be some of the is at fault.

A lot of chips are supported by the IDE, some natively, some if you install some extra files in the hardware folder. The Sanguino for example, can be programmed in it. (That's the Atmega644 I think). The 644 gives you 64 Kb of program memory and 4 Kb of RAM.

Or the 1284, which I assembled on a breadboard here:

This has somewhat more RAM (16 Kb) and somewhat more program memory (128 Kb).

Also keep in mind that C strings by default on AVR will copied to RAM as well.
So things like:

char *var = "HELLO";
serial.print("HELLO");

will eat up 6 bytes of RAM.

Build your code with the verbose option so you can locate the .elf file.
Then run nm on the .elf to see your symbols to be able to identify
what is using your RAM.

See the nm man page for more details but
here is a sample useful command to get you started:
avr-nm -n -C -S *.elf > nm.out

In the nm output, the symbols with "B" near the bottom are the ones using up bss (RAM)
(This won't show the literal strings).

You can also get useful information from the objdump command.

--- bill

Optimizing your code is good and all but there comes a time when you need to throw in the towel and pony up for more capable hardware. Given the number of libs you're using, I wouldn't even bother trying to make it work on an Uno. Get the 1284.

Opinions only, of course. But you're asking a lot of 2K RAM. If 8K isn't enough, then I'd start looking at object dumps. Maybe I'm just lazy. :wink:

It's not really a clone if it's a different chip, more like a spinoff.. I needed more ram when using the ENC28J60 ethernet chips. The TCP stack is in ram, rather than in the chip, so it takes most of the ram. So I used the Teensy++ 2.0, really cheap, uses the Arduino IDE just like I'm used to, and has like 8k of ram. Though nowadays, I'd use the Teensy 3.0, it's got 16k of ram and is cheap as dirt.

Nice tutorial!!! Thanks a lot for sharing!

bperrybap:
Build your code with the verbose option so you can locate the .elf file.
Then run nm on the .elf to see your symbols to be able to identify
what is using your RAM.

See the nm man page for more details but
here is a sample useful command to get you started:
avr-nm -n -C -S *.elf > nm.out

In the nm output, the symbols with "B" near the bottom are the ones using up bss (RAM)
(This won't show the literal strings).

You can also get useful information from the objdump command.

--- bill

Thanks for the tip! I was wondering if it was possible to see how much RAM will program take before loading it to the chip. I assume all these options are not available via standard IDE tho? I couldn't find verbose, etc. What do I need to be able to run all these commands? Some kind of AVR studio? Will it be compatible with .ino/.pde sketches and libraries I have?

UnaClocker:
It's not really a clone if it's a different chip, more like a spinoff.. I needed more ram when using the ENC28J60 ethernet chips. The TCP stack is in ram, rather than in the chip, so it takes most of the ram. So I used the Teensy++ 2.0, really cheap, uses the Arduino IDE just like I'm used to, and has like 8k of ram. Though nowadays, I'd use the Teensy 3.0, it's got 16k of ram and is cheap as dirt.

WOW I'm leaning more and more toward Teensy 3.0 It's just $20 and it has more ram than $50 Mega! So small too, and for this money I probably won't even have to bother with making my own PCB and 1284 chip...

Thanks all for the useful info. I love Arduino forums, everyone is so helpful! I learned so much! :slight_smile:

bratan:
Thanks for the tip! I was wondering if it was possible to see how much RAM will program take before loading it to the chip. I assume all these options are not available via standard IDE tho? I couldn't find verbose, etc. What do I need to be able to run all these commands? Some kind of AVR studio? Will it be compatible with .ino/.pde sketches and libraries I have?

To use the verbose mode, if on pre 1.x IDE press the key when building.
If on the newer IDE you have go to the [File]->[Preferences] dialog.

To run the commands it depends on what OS you use.
They are run from the command line which is why you have locate
the directory where the IDE is building images.
If you are stuck using windows, then the commands are there, they are just a bit harder to locate
as they are down in a directory under where the IDE is installed.

But before I'd jump ship to another board/device, particularly one that is a different
architecture and limited to 3v, I'd definitely make sure to understand what the real issue is
and know what it using all the RAM to make sure that there is not some other quick solution to solve
it. (like moving string literals to flash).

--- bill

I was wondering if it was possible to see how much RAM will program take before loading it to the chip.

Not really. The compiler can't know if you are going to do malloc a thousand times, for example. You can use some of the code around that reports the amount of free RAM after you loaded the program, that would give you a good guide if you don't do dynamic memory allocation (eg. use the String class).

From a post I saw a week or so ago, I have a feeling that the new version 1.5 IDE does report the amount of RAM allocated statically by your code.

Using dynamic memory allocation (including the String class) is a bad idea in small embedded systems.

dc42:
From a post I saw a week or so ago, I have a feeling that the new version 1.5 IDE does report the amount of RAM allocated statically by your code.

Using dynamic memory allocation (including the String class) is a bad idea in small embedded systems.

I'm not seeing it.
I only see the same stuff:
.cpp arduino munged files, .d dependency files, .o objects, .elf image file, and .hex image

I don't see any .lss or nm output files being created.

Do you have a link to that post?

--- bill

Check out this improved 1.0.2 IDE: http://arduino.cc/forum/index.php/topic,118440.0/topicseen.html
You'd think they'd roll those improvements into the new 1.5 IDE, but I guess not. Can lead a horse to water, can't make him drink....

That's probably the IDE that was referred to in the post I saw, not the 1.5 IDE!

Well if the improvements don't make it into the final 1.5, I'm sure those guys will apply them to 1.5 afterwards, like they did with 1.0.2..

I used FreeRam function to test how much RAM is being used.
Running my clock sketch it shows from 1167 to 922 available (depending which menu I'm in).
However as soon as I enable Waveutil.h library it jumps down to 110 bytes. I'm not even playing audio at this point. So I don't think there's anything I can do to optimize it (I don't want to mess with WaveHC library) other than upgrade RAM :frowning:

How about posting your clock sketch?