Pages: [1] 2 3   Go Down
Author Topic: Arduino clones with more RAM than Uno?  (Read 5046 times)
0 Members and 1 Guest are viewing this topic.
New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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! smiley
Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Sweden
Offline Offline
Sr. Member
****
Karma: 13
Posts: 257
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

- 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". https://github.com/maniacbug/mighty-1284p
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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...
- 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". https://github.com/maniacbug/mighty-1284p
Awesome! I'll check it, thank you so much!
Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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:

http://www.gammon.com.au/forum/?id=11637

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

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2642
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Also keep in mind that C strings by default on AVR will copied to RAM as well.
So things like:
Code:
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
Logged

Anchorage, AK
Offline Offline
Edison Member
*
Karma: 42
Posts: 1176
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.  ;-)
Logged

Tacoma, WA
Offline Offline
Full Member
***
Karma: 4
Posts: 192
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Brian from Tacoma, WA
Arduino evangelist - since Dec, 2010.

New York
Offline Offline
Sr. Member
****
Karma: 4
Posts: 366
xronosclock.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Or the 1284, which I assembled on a breadboard here:
http://www.gammon.com.au/forum/?id=11637
This has somewhat more RAM (16 Kb) and somewhat more program memory (128 Kb).
Nice tutorial!!!  Thanks a lot for sharing!
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?
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!  smiley
Logged

Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info smiley

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2642
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 <SHIFT> 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
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
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).
Logged

United Kingdom
Offline Offline
Tesla Member
***
Karma: 223
Posts: 6593
Hofstadter's Law: It always takes longer than you expect, even when you take into account Hofstadter's Law.
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Formal verification of safety-critical software, software development, and electronic design and prototyping. See http://www.eschertech.com. Please do not ask for unpaid help via PM, use the forum.

Dallas, TX USA
Offline Offline
Faraday Member
**
Karma: 63
Posts: 2642
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Pages: [1] 2 3   Go Up
Jump to: