Getting around the 32K limit of memory in a 328

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.

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.

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.

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.


The 1284P-PU looks like a better idea.

There is also the progam bitlash, where you run an intepreter on the '328 and it runs code that is on SD.

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

Onboard USB support with mikroe483 from, or offboard with an FTDI Basic or equivalent if your embedded project doesn't USB support after test/programming.
Cross Roads Electronics for schematics & suggested PL