Best processor to switch to?

Hi everyone,

I'm currently using a Atmega328 in a custom PCB project. Unfortunately I'm out of pins, and also want to add USB in the next iteration. I can add USB with the current Atmega328 board using a cheap USB to Serial chip, but my understanding is there are other chips with it built in.

My question is this: what processor do people recommend to upgrade to has more IO pins, hopefully USB included, and also has some room to grow in the future in terms of functionality. I was looking at the Atmega2560, but it's quite expensive compared to the 328. What about some of the newer ARM processors?

Happy to hear anyone's opinions on this - I don't mind having to learn some different ways to code a different chip if it means more options in the future.

Thanks.

Have a look at the Arduino Nano 33 IoT. It uses a Microchip SAMD21 ARM Cortex-M0+ based microcontroller. The same is used by Adafruit Feather M0 WiFi.

https://store.arduino.cc/arduino-nano-33-iot

https://www.adafruit.com/product/3010

Both are well supported with examples and allow you to do some wireless stuff, have way more memory and a nice little 32-bit ARM processor for a start.

From there you can move up in many directions. There are countless Cortex-M based microcontrollers from all manufacturers. The top end ARM Cortex-M that can still be called a microcontroller run at 400 or even 600MHz.

https://store.arduino.cc/portenta-h7

https://www.pjrc.com/store/teensy40.html

The Teensy 3.5. and 3.6 are somewhere it between and have a lot more pins but still the breadboard form factor.

https://www.pjrc.com/store/teensy36.html

I have a Atmega16. But I suggest you to get a Atmega32 which is the more powerful microcontroller. It has 4 ports (8 bit) Which are total 32 IO pins. I recommend you that.

the best bet is always the same,

the cheapest, the powerfull enough for pretty every project, the chip that sucks less power for what it offer, the chip with enough memory for pretty everything, the one with USB AND WIFI, the one really small....

the answer is always ESP8266 preferably on D1 Mini board from Lolin.

Sblantipodi, that guy is asking for a microcontroller which should have more IO pins. But ESP8266 doesn’t have. There are many other platforms but the cheap, reliable and less power consuming one is ESP32. It has all the features he asked for.

I guess it highly depends on your exact requirements.

Port expanders (I2C or SPI) and shift-registers are one way to expand the IO capabilities. A PCA9685 can give you 16 PWM outputs. Multiplexers can be used for more analog inputs. And so on. Yes, they will take space but you did not specify that as a requirement ;)

I would concentrate on finding the controller with the USB interface and take it from there (see answers above).

PS: I've never ran out of pins but usually run out of RAM :(

sterretje: I guess it highly depends on your exact requirements.

Port expanders (I2C or SPI) and shift-registers are one way to expand the IO capabilities. A PCA9685 can give you 16 PWM outputs. Multiplexers can be used for more analog inputs. And so on. Yes, they will take space but you did not specify that as a requirement ;)

I would concentrate on finding the controller with the USB interface and take it from there (see answers above).

PS: I've never ran out of pins but usually run out of RAM :(

you can connect tons of i2c device on the same PINs, if you need all that pins probably there is something wrong in the project. :)