I have a working project on my Arduino Uno to control an RGB-LED (or -Strip) and want to move it onto a circuit board. In this process I also want to replace the Arduino with a dedicated microprocessor.
What would be the most efficient option to do this? (apart from just a ATmega328P)
Some specs of the project to be migrated (according to the console of the Arduino IDE):
Project requires 4 analog pinouts
Sketch uses 10,600 bytes
Global variables use 490 bytes
Code uses the IRRemote library
makes heavy use of the millis() function
I have found this library for the ATtiny, the ATtiny85 version of which would, to my understanding, have just enough RAM.
Would the ATtiny85 work? Other suggestions? Thanks!
Can you re-phrase that? Uno has zero analog outputs...
You require one digital output to drive your strip. Don't know what else you need yet.
Maybe you could consider attiny84. It's almost the same as attiny85 but with more pins. You would need to reduce the compiled sketch size to below 8192 bytes for either '85 or '84. That might not be impossible. Post your code. We might spot some ways to shrink it. Also you could try switching on Link Time Optimisation (LTO).
There are other ways to move to a circuit board while still using the same chip. Nano 3 and Pro Mini both use the same chip as Uno. Or you can use a bare atmega328 chip. If 8MHz is fast enough (which is true for almost all projects) then you may not need a crystal+caps.
If it just has enough ram (512 bytes?), it might very well not have enough ram. You will need to count local variables and stack usage as well for total memory usage.
The tiny85 doesn't sound like it has enough program memory.
It would fit in an atmega168, or probably an attiny1634, but there isn't much of a reason for the change. In quantity, you'd save a few cents per chip, maybe.
You can put a 328 on a board that only breaks out some of the pins, and it gets significantly smaller. Adafruit trinket pro comes to mind.