Use external flash for sketches

Hi everybody!

I have a question, mostly for knowledge. My project is very simple, is based on relays and only needs 2+4 pins on an arduino (2 digitals, Tx, Rx, Power and GND) but needs 20KB of flash memory for the sketch.

I'm currently prototyping with an UNO, but I'm interested in reducing the size, and recreate a lightweight board using only what necessary (few pins, resistors on them, external regulator, etc...). Ideally, I would like using an Attiny, but their flash is very limited.

Is there a way to make an MCU use an external FLASH and/or SRAM?

Not an AVR. Have you seenthe price of pro mini clones on ebay? They're like 2 bucks.

On other chips, this is possible - for example the esp8266 has no on chip flash, and uses external flash chip.

Have you checked that your sketch isn't doing anything that wastes space unnecessarily?

DrAzzy:
Not an AVR. Have you seenthe price of pro mini clones on ebay? They're like 2 bucks.

Price isn't the problem currently, I have found few (or very rare) shops in Paris, France, where I can find electronics parts AND more precisely, mini clones. So I'm covered, thank you :smiley:

I was asking just for knowledge, because there are too many unnecessary pins, but at Atmel, fewer pins also means less memory in general.

DrAzzy:
Have you checked that your sketch isn't doing anything that wastes space unnecessarily?

Actually, I'm prototyping with Blynk, to easily make iOS controlled switches. And Blynk alone is already big (~20kB, according to Arduino IDE)

Sounds like the Pro Mini is your man.

You have the SMD chip, can't get much smaller than that - or if you can, not much point.

Let's face it, your power supply is going to be bigger than the Pro Mini.

Why do you think an attiny with external flash would be smaller than a pro mini?

actually attiny like digispark or 1dunio would be MUCH smaller than promini. like 5:1 size difference. bare attiny soic deadbug wired to serial flash would be 50:1 difference.

Paul__B:
Let's face it, your power supply is going to be bigger than the Pro Mini.

If you're talking about the desktop PC on which it will be permanently plugged... You're right, the power supply will be bigger :stuck_out_tongue:

mart256:
Why do you think an attiny with external flash would be smaller than a pro mini?

I think that because attiny is smaller and I just need few pins (2 digitals). So a bare attiny would always be smaller in my thought

john1993:
bare attiny soic deadbug wired to serial flash would be 50:1 difference.

So you're saying that attiny could be wired to serial flash?

Thank you all for your information. I want to remind you that it's just curiosity, I already have a pro mini clone, I will use it, but anyway I still want to know if it's possible and how.

So you're saying that attiny could be wired to serial flash?

any avr, tiny or mega, with at least 3 pins can access serial flash. i built several hundred for a customer last year for rodent bio monitor using t13 and atmel AT25040. soldered almost 1:1 one on top of the other. total cost less than a dollar. 3 analog, digital, or serial inputs. they were not much bigger than a matchhead. rechargeable lithium battery.