Go Down

Topic: Arduino clones with more RAM than Uno? (Read 6516 times) previous topic - next topic

UnaClocker

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....
Brian from Tacoma, WA
Arduino evangelist - since Dec, 2010.

dc42

That's probably the IDE that was referred to in the post I saw, not the 1.5 IDE!
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.

UnaClocker

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..
Brian from Tacoma, WA
Arduino evangelist - since Dec, 2010.

bratan

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 :(
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

dc42

How about posting your clock sketch?
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.

bratan

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

bperrybap

Look at the nm output.
You can see what is eating up your space.


The wavehc stuff appears to be commented out however
a a quick looks show two 512 byte buffers in wevehc.

Another big guy is a 256 byte shadow buffer for the graphics.
That is quite a bit just right there.
Total BSS without wavehc is currently 0x2c8 which is 35% of your
total RAM. Add in 0x400 for the wavehc buffer1 and buffer2 buffers and you up to 0x6c8
which only leaves 0x138 for everything else including stack  and
I'm sure there are other variables in the library as well too.

There are several variables in the main sketch that look like they are not
changing and could (should) be declared const to eliminate some storage there.

The wavehc does run on m168 and will automatically drop the buffers down to 256 if on
that part. There are some other limitations that come with that (bit rate etc) but you
may want look in the wavehc header and see if you can get away with using the smaller
buffers by patching the defines like they are on a m168.

Best thing is to run nm and objdump to start looking at where the memory is going
and see if there is anything easy (like putting the wavehc in m168 mode) that can be done
to save RAM.

--- bill


CrossRoads

Duemilanove-style 1284 is not hard to make.

http://www.crossroadsfencing.com/BobuinoRev17/1284_thruhole2.JPG
I sell bare boards for $5 shipped to US locations, scrounge  the parts  you need or pick up for ~$15 at mouser.
On board (MIKROE483) or off board USB/Serial (FTDI Cable or similar) supported too.
PL here www.crossroadsfencing.com/BobuinoRev17/
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

bratan



The wavehc stuff appears to be commented out however
a a quick looks show two 512 byte buffers in wevehc.

Another big guy is a 256 byte shadow buffer for the graphics.
That is quite a bit just right there.
Total BSS without wavehc is currently 0x2c8 which is 35% of your
total RAM. Add in 0x400 for the wavehc buffer1 and buffer2 buffers and you up to 0x6c8
which only leaves 0x138 for everything else including stack  and
I'm sure there are other variables in the library as well too.

There are several variables in the main sketch that look like they are not
changing and could (should) be declared const to eliminate some storage there.

The wavehc does run on m168 and will automatically drop the buffers down to 256 if on
that part. There are some other limitations that come with that (bit rate etc) but you
may want look in the wavehc header and see if you can get away with using the smaller
buffers by patching the defines like they are on a m168.

Best thing is to run nm and objdump to start looking at where the memory is going
and see if there is anything easy (like putting the wavehc in m168 mode) that can be done
to save RAM.

--- bill



Wow thank you! I'll give it a try. I also had no idea that declaring consts instead of variables will save ram.

Duemilanove-style 1284 is not hard to make.
I sell bare boards for $5 shipped to US locations, scrounge  the parts  you need or pick up for ~$15 at mouser.
On board (MIKROE483) or off board USB/Serial (FTDI Cable or similar) supported too.
PL here www.crossroadsfencing.com/BobuinoRev17/

That's a beauty!  I think I'll order a PCB from you. Will it work with 644p? I had hard time finding 1284, they seem to be out of stock almost everywhere. I did request 644p sample from Amtel and it's on it's way.
Xronos Clock - A talking arduino based alarm clock is now available. Check out xronosclock.com for pictures, source code, schematics, and purchasing info :)

retrolefty

Quote
Will it work with 644p?


Yes, 1284p and 644p in DIP at least have same pin out.

Lefty

cyclegadget

@Bratan

  CrossRoads could probably hook you up with a chip. I have purchased several of CrossRoads PCBs and one of his Bobuinos that is loaded with features! CrossRoads does some great work!

  Also, on the subject of the 1284, I am using one of CrossRoads SMT 1284 boards to make a 20MHz version for fun. Someone recently made a bootloader so, that the chip will work properly at the higher frequency. I am considering putting a socket for the crystal to sit in so that I can try other frequencies. The socket will be easy to remove later if I do not like it.
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

CrossRoads

Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

dc42

I took a look at your sketch. Which DS1307 library are you using?

As well as changing the variables that represent unchanging data (e.g. pin numbers) to const, another easy win is to replace Serial.println("text") in setup() by Serial.println(F("text")).

I was unable to find monthShortStr(), but I suspect the month strings are another candidate for moving into PROGMEM.

Table divider[12] occupies RAM but appears to be unused.

Variable tempString should be local to the function in which it is used, like timeString. Similarly for tempChar.
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.

john1993


Duemilanove-style 1284 is not hard to make.
I sell bare boards for $5 shipped to US locations, scrounge  the parts  you need or pick up for ~$15 at mouser.
On board (MIKROE483) or off board USB/Serial (FTDI Cable or similar) supported too.


i had a similar requirement for large ram and was given one of your m1284 boards. im very impressed with the design. do you have a link to a bootloader? also can you tell me what avrdude command line would be used to load a small test program to that with a com5 dongle?

cyclegadget


Here is the thread about the 20MHz bootloader for the 1284P. I have not tested it yet.  http://arduino.cc/forum/index.php/topic,128604.msg968632.html#msg968632

Here is the bootloader I use for boards from CrossRoads https://github.com/maniacbug/mighty-1284p

By the way, the board has to be selected as Bobuino or your pins will not match. There are other 1284 variants that have different pin mapping. The problem may apply to the first link I gave you.
Good links: Eagle tutorial= http://www.youtube.com/playlist?list=PLDE1858BD83D19C70
General Arduion tutorials = http://tronixstuff.wordpress.com
http://www.gammon.com.au/forum/bbshowpost.php?bbtopic_id=123

Go Up