This is my first post and i'm relatively new to the Arduino World.
I'm working on a little project using the FastLED library.
I've got this working using the main Arduino board with no issues.
I also used a D1 Mini and uploaded my sketch to this and used that stand alone and it also works perfectly however this is still quite a large board with tonnes of other features I don't need (wifi etc).
What I now want to do is write my sketch to a smaller micro controller I can integrate into my board.
The sketch would only ever be uploaded to the MC once and all it would need to do is read and run the sketch in exactly the same way the D1 mini does when it receives power (5v).
The sketch is only 265000 bytes so not big by any means.
Happy to write the sketch to the MC using the Arduino if possible then put the MC into my board.
Could anyone suggest a MC I could use and how I would get the sketch onto it?
Thanks for the reply , my tools, skill is limited at this point and i'm only using breadboards and such to develop my idea. So DIP SMT ICs would be the easiest.
However this is only so I can get the prototype up and running. Once I have this ill be going to a PCB house to get the thing properly developed so the one I use now might not necessarily have to be the one used in the finished product.
I don't understand what you mean by that. DIP and SMT are two different things.
DIP packages are through hole. These can be plugged right in to a breadboard, stripboard, perfboard. The pitch on the pins is 0.1 inch, which is easy to solder.
SMT packages are surface mount. These cannot be plugged into a breadboard. The pitch of the pins varies depending on the package, but it will be less than 0.1" and thus is more challenging to solder. Some SMT packages are only a little more difficult to solder than through hole, while others are very challenging, especially if you don't have the specialized equipment.
pert:
I don't understand what you mean by that. DIP and SMT are two different things.
DIP packages are through hole. These can be plugged right in to a breadboard, stripboard, perfboard. The pitch on the pins is 0.1 inch, which is easy to solder.
SMT packages are surface mount. These cannot be plugged into a breadboard. The pitch of the pins varies depending on the package, but it will be less than 0.1" and thus is more challenging to solder. Some SMT packages are only a little more difficult to solder than through hole, while others are very challenging, especially if you don't have the specialized equipment.
Sorry should have been a DIP/SMT ICs rather than a space. I have done some SMT stuff but im guessing it wasn't the challenging stuff. Happy to stick with DIP for ease now as I suspect some MCs will be a lot more challenging on the SMT front.
Tell us the memory usage shown after compiling for the Mega
265000 bytes is fairly big in the world of embedded systems, especially for the AVR microcontrollers that are most popular with Arduino users, but the ESP8266 has a lot of memory overhead for the WiFi stuff. Compiling for the Mega will give us a better idea of how much memory will be needed.
Tell us the memory usage shown after compiling for the Mega
265000 bytes is fairly big in the world of embedded systems, especially for the AVR microcontrollers that are most popular with Arduino users, but the ESP8266 has a lot of memory overhead for the WiFi stuff. Compiling for the Mega will give us a better idea of how much memory will be needed.
Apologies yes this was compiled under the ESP8266 so messed with the numbers a little.
Heres the output using the Board suggested above......
Sketch uses 3780 bytes (1%) of program storage space. Maximum is 253952 bytes.
Global variables use 397 bytes (4%) of dynamic memory, leaving 7795 bytes for local variables. Maximum is 8192 bytes.
A small AVR chip popular in the Arduino world is the ATtiny85. That chip comes in a DIP package for easy prototyping on a breadboard, then you could switch to a smaller surface mount package for the finished board. However, it only has 512 bytes of SRAM, which might not be enough for your local variables after you subtract that 397 bytes you're using for globals.
There are a couple ATtiny that have 1 kB of SRAM, but they are not available in a DIP package.
If you can't work with the ATtiny, the next one up the line is the ATmega328P used in the Arduino Uno, Nano, and Pro Mini. This is available in DIP package, but you'll probably be better off just using an Arduino board for prototyping, unless you have a specific circuit you want to play with. The ATmega328P is available in a smaller (9 mm x 9 mm including pins) TQFP package that is possible to hand solder with a little practice. It is also available in an even smaller (4 mm x 4 mm) QFN package, which is very challenging to hand solder with an iron, but can certainly be soldered using standard surface mount tools.
There are a few other chips in the ATmega328P family like the ATmega168 that have less memory and a bit lower price, which you might consider if you were making a product you wanted to cost optimize. Any code you write for the ATmega328P will port easily to the ATmega168.
There are some other Arduino friendly microcontrollers that you could consider, like the ATSAMD21G18 used on the MKR boards, but they won't be available in a DIP package, and won't be quite as well supported. On the other hand, some of the more modern chips like the ATSAMD21G18 offer far superior performance compared to the 8 bit AVR chips. The question is whether you really need that performance for your application.