Go Down

Topic: Need more code space, not data space (Read 4008 times) previous topic - next topic

Titanium69

So, I see all the references to EEPROM and that's where I'm leaning towards, however I need more space for larger sketches not data. Looking at the EEPROM library, I only see references to reading and writing data.
How do I get Arduino to use the EEPROM (or any other memory) for executing my sketch?
I have my SD and it works fine. I could either write my sketch to the EEPROM or I could copy it off the SD and move it into RAM at runtime.
Does anyone have a suggestion or confirm on the limitation of the Arduino sketch size?

Thanks in advance.
Allan
You laugh I laugh
You cry I cry
You fall off a bridge I laugh so hard I fall off with you

retrolefty

What you want to do is not really possible on a arduino. Code goes into the built-in FLASH memory, not the internal (or added external) EEPROM memory. Adding a SD would also not solve the problem of getting compiled code into the flash memory. There is a arduino 2560 mega board that contains 256KB of flash memory, is your compiled sketch code larger then that?

Lefty

Grumpy_Mike

Quote
I could copy it off the SD and move it into RAM at runtime.

While many desktop systems work like this controllers like the arduino do not run code from RAM but from the Flash ROM. What you want to do is not possible.

CrossRoads

That depends on what uC you have, as "Arduino" covers several devices.
For a 328 based board, you get around 30,000 bytes for your sketch.

If you need more, than consider stepping up to a 644p/1284p type part, with more memory & IO.
Search for "Hacking the uno!" where I wired a 644p up in place of a 328.

Atmel has a webpage showing all the variations in the 8 bit AVR family. I'd post a link if I could get my browser to respond ...
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.

robtillaart


Reminds me of a discussion today about the ChipKitz that should be compatible with Arduino
See - http://www.digilentinc.com/Products/Detail.cfm?NavPath=2,892,893&Prod=CHIPKIT-UNO32 -

It has more of everything, might be an alternative.

That said, there is also the option that your code is not optimal. If you want the forum to have a look at it, post it including requirements what it should do and links to the datasheets. You might just get those extra free bits needed :)

Rob
Rob Tillaart

Nederlandse sectie - http://arduino.cc/forum/index.php/board,77.0.html -
(Please do not PM for private consultancy)

CrossRoads

Here's the parametric comparison I was trying to pull up

http://www.atmel.com/dyn/products/param_table.asp?category_id=163&family_id=607&subfamily_id=760

http://arduino.cc/forum/index.php/topic,56567.0.html

This prototype was made for Skyjumper, he needed dual serial (USB and RS232) and lots of memory, and not so much other IO - this one has 3 LEDs, and 3 transistors to close some external contacts. Software serial planned for additional IO.
He's upgraded to 1284P for even more memory, and added an SPI dual UART in place of software serial to allow for better number crunching performance.
$8 1284 & $4 dual UART  vs $16 1280 or $18+ dollar 2560. Everything's a tradeoff!
Assembly is also a little less complex with the 44 pin TQFP vs the 100 pinTQFP.
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.

mmcp42

some of your nuts look awfully close to pads there young sir!
there are only 10 types of people
them that understands binary
and them that doesn't

CrossRoads

"young sir", that's funny!
Not to worry, there are nylon washers under the nuts.
And nylon standoffs under the board to keep the whole thing level.
It has been working fine like that for Skyjumper since, oh, February or March.
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.

Titanium69

Thanks everyone for your responses. First step to try the 2560 and go from there. Thanks again for your insights.
You laugh I laugh
You cry I cry
You fall off a bridge I laugh so hard I fall off with you

Go Up