Hi there, I am looking for help choosing the right board for my needs. In order to get good answers and not wasting your time, I am writing a bit more about the project further down. Sorry for the long post.
The Situation: Working project, wiring 100 % done, programming 80 % done but memory capacity problem. Asking for help choosing a microcontroller replacement.
The problem: 99% of flash memory used and 50-60% of the RAM when the program starts. But I have not integrated everything I would like to (see below for the actions I have performed to decrease memory usage)
The question: Which is the best board to use that has more RAM and flash but maintains full compatibility with the Arduino code? I came across ESP32, ESP8266, teensy, Arduino MEGA, but I don’t know more than the general pros and cons and also there might be other and better options.
Side note: Hope it is okay to ask for other boards in this forum. Feel free to move the topic if you think it should belong somewhere else...
My priorities:
- Compatibility with Arduino code
- No external programmer needed (I know that the MEGA can act as keyboard but you have to use an external programmer afterwards which I do not own and do not wish to buy)
- Compatibility with the used hardware (see below)
- Price (this is not crucial, but I don’t want to pay 30 bucks if I can get it for 10)
Size and power needed are no concern.
More about the project:
The idea: “Button box” with 52 buttons, 8 rotary encoders and 8 OLED displays showing dynamic text. Works as keyboard to a computer (pressing a button sends a keystroke)
The hardware:
1 x pro micro with AtMega32U4 5V at 16MHz
8 x 1,3 inch OLEDs with SSh 1106 controller (1,3 Zoll OLED Display I2C SSH1106 Chip 128 x 64 Pixel I2C Anzeigemodul – AZ-Delivery)
4 x MCP23017 IO expander (MCP23017 Serielles Interface Modul kompatibel mit Arduino – AZ-Delivery )
1 x PCA9548A IIC multiplexer (as displays have the same IIC address) (PCA9548A I2C IIC Multiplexer kompatibel mit Arduino – AZ-Delivery )
The libraries:
IoAbstraction (debouncing, rotary encoder functions, dead useful in general) (GitHub - davetcc/IoAbstraction: Rotary encoders, fully debounced switches, EEPROM support on Arduino and mbed - direct and over I2C)
U8G2 library for driving the displays (GitHub - olikraus/u8g2: U8glib library for monochrome displays, version 2 )
And some other more standard arduino libraries
My programming skills in C/C++: Beginner, sometimes intermediate. Yes, it could very well be that someone with better skills would make it happen with the current hardware. But unless I find a silver bullet…
What I have done to reduce memory usage: Used PROGMEM or F-macro where possible, deactivated parts of the used libraries, put parts of the text to display in the python program on the PC to only send relevant data in parts.
... as I said, really long post. Sorry for that!
And thanks for the help!
Tom