pyr0ball / pyr0piezo

An AVR/ARM based piezoelectric sensor for use in ultra-precise applications
https://docs.pyroballpcbs.com/
Other
71 stars 23 forks source link

Arduino Code is too large for Atmega48 (88+ is ok) #3

Closed pyr0ball closed 4 years ago

pyr0ball commented 5 years ago

Current sketch uses 5900 bytes, well over the 4kb limit of the mega48.

Refactor using low-level code will be required to fit the sketch on the smaller flash size, or switch to mega88+ may be required

teemuatlut commented 5 years ago

Hey I saw your project on reddit and browsed this github page for a bit. Is this issue still ongoing for you?

I spent a few minutes making changes and with the serial stuff taken out, I got it to 2426B of progmem and 47 of sram. I suppose it might be possible to include the serial parser as well considering an empty sketch takes 382B and with Serial.begin(9600); added it increased to 1480B.

pyr0ball commented 5 years ago

I'm actually migrating over to the ATSAMD21E series of MCU's after the beta testing is complete, which has enough memory not to need optimization (though that's not the main reason I'm switching).

Also serial + i2c are going to be required services in the post-beta versions.

I'm trying to keep the code and designs as easy to work with as possible so that other community members can futz around with them.

I do appreciate the offer to help though!

pyr0ball commented 4 years ago

Closing as the firmware has definitely reached a point where 4K will never be enough