"Any benefit can become a limitation."
I’m sure you’re all pretty familiar with the ubiquitous Pro Mini.
Or at least, this guy, his cheap (~$2) counterfeit cousin!
Based around the ATmega 328p, the “trusty” Pro Mini quickly became a feature of many of my DIY electronic projects.
There wasn’t a sensor or actuator I couldn’t connect to it via some sort of associated circuitry.
And then there were the libraries!
Awesome people around the world had written code to interact with almost anything and everything else.
But that was sometimes where I would hit my first limitation.
32KB Program Memory
Over the years, feature-creep™ has resulted in some of my projects pushing the limits of the 328p’s 32KB program memory.
For example, pan/tilt stepper solar-powered sun-tracking long-range wireless over-the-air programmable crop monitor...with camera and display anyone?! ;p
Once I started stacking libraries, adding features and increasing the number of external entities I was interacting with, my compiled code size (understandably) started to balloon.
Sketches that would get too far above 90% of the program memory fell prey to memory leaks.
Others would, of course, simply exceed the compiled 32KB limit altogether.
At first, I would attempt to fix the memory leaks, then it was optimize the code, add #IFDEFs to debugging portions and finally play with compiler flags.
If you’re wondering at this point whether all this effort was worth it, well, quite frankly so was I!
Learning to write better code is great.
[To be continued with…]