Pages: [1]   Go Down
Author Topic: Getting around the 32K limit of memory in a 328  (Read 613 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Faraday Member
**
Karma: 68
Posts: 2820
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

The Arduino UNO as ISP can program a 328 with a sketch
I think we can place a number of sketches onto a SD card (their Hex o/ps).
Can we then read a sketch from the SD card using the ISP UNO and program the 328?
Hence we could run larger sketches than 32K and use the SD card to pass values form one program to another.
Maybe using the dual board CrossRoads has?

NOTE: I want to stick with the MEAGAA328 chips.

Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Offline Offline
God Member
*****
Karma: 7
Posts: 647
"In this house, we obey the Laws of Thermodynamics" Homer J. Simpson
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I am not sure I 100% understand your question.
However I think you should research how people used to write large programs using systems which had limit memory or addressable memory e.g. paging and bank switching.

At the end of the day the size of your program is not limited by the amount of memory your processor can address or the amount of RAM installed. Of course writing a paging system is not trivial.
Logged

UK
Offline Offline
Shannon Member
****
Karma: 223
Posts: 12630
-
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

You could do, but as a code paging solution it's a pretty horrible approach because it's going to be extremely slow - and you'd have to worry how long your flash memory is going to last. You'd be better IMO looking for alternative approaches such as using an interpreter, or simply moving to a more appropriate platform. I know you say you want to stick with the 328 chips, but that doesn't mean it's a sensible platform for what you're trying to do.
Logged

I only provide help via the forum - please do not contact me for private consultancy.

Atlanta, USA
Offline Offline
Edison Member
*
Karma: 55
Posts: 1825
AKA: Ray Burne
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
NOTE: I want to stick with the MEAGAA328 chips.

Yes, but IF you were more flexible in that constraint, you could move to the Bobduino 1284P-PU, a 40 pin DIP... CrossRoads has a fantastic board.  You gain 8x the SRAM or the 328 and half the flash as a Mega2560.  Everything you know about the 328 carries over plus you get more I/O ports.  Alas, shield investment could be an issue to dome degree, but CrossRoads could speak more to that point.

You could write/patch a bootloader to move sections of code from an external flash/SD device into a 328 and then force a jump to the startup vector but this would normally start the Arduino initialization for the runtime variables and program variables.  To have a code overlay of just some of the 328, the Arduino compiler (AVR-GCC) would have to compile the second/overlay differently and the bootloader would have to treat code from SD/ext. Flash differently.  Many on the forum that used to work with mainframes and minicomputers will remember code overlays as very nasty business.

Ray
Logged

Offline Offline
Faraday Member
**
Karma: 68
Posts: 2820
The last thing you did is where you should start looking.
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thanks
The 1284P-PU looks like a better idea.
Logged

The way you have it in your schematic isn't the same as how you have it wired up! That goes for me too.

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 548
Posts: 27393
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

There is also the progam bitlash, where you run an intepreter on the '328 and it runs code that is on SD.
http://bitlash.net/
Bill Roy contributes here regularly.
The 1284P is a very nice chip, lots of IO, and designed to be compatible with shields.
(Serial is still D0/D1, SPI is still D10-11-12-13, I2C can be A4/A5 with a jumper setting, or they can be on the "new" pins and A4/A5 can still act as A4/A5 or D18/D19. PWM ended up on D7-8-9-10-30-31, so you can still have 6 PWM and not lose SPI capability. And the chip supports 2 hardware serial ports (Serial, Serial1, and 3 hardware interrupts, INT0, 1,2).
Add the mighty1284 core files from maniacbug, and I can post an updated pins_arduino.h file that corrects a couple things. (I should put that info with the board link! Will remember one of these nights, vs posting it here over and over).
https://github.com/maniacbug/mighty-1284p
Onboard USB support with mikroe483 from mouser.com, or offboard with an FTDI Basic or equivalent if your embedded project doesn't USB support after test/programming.
http://www.crossroadsfencing.com/BobuinoRev17/ for schematics & suggested PL
« Last Edit: August 09, 2013, 09:23:50 am by CrossRoads » Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: