What CPU to replace ATMega2560?

I like ATMEGA2560, but it is expensive.

I have used it in several projects and I have Gerber files if I need CPU boards for myself, but its price has gone up. It costs now about 17£$€ at the PCB house I use.

So what is a good upper end CPU today with full Arduino library support? I would prefer +5V IO, but I can live with 3.3V.
I have Arduino Due boards, but it is a bit old, I think.

  • Many users here use an ESP controller, lots of versions available.
    I have used these:

  • Here is a good web site to help:

I pretty much depends on the code You want to run.

Which libraries?

Boards like that will not exist. You will find libraries that make use of low level AVR code instead of the Arduino specific functions and those libraries will not compile for boards with other processors.

OK. What is good modern AVR CPU. Or is there one.

About libraries, I don't know all yet. Now, some low cost Aliexpress display. temperature sensors , PT100 and so on, some shields or modules with Skyworks RF modules. There are plenty of interesting shields to play with.

There is or at least was a ST ARM CPU. How is its support. I have made some ARM boards.

Another vote for esp32.

Portenta page talks only about mini modules with BGA chips. I have not made a BGA boards, is there a CPU in LQFP 100 package

The new AVR128da64 and AVR128db64 look pretty nice, but they top out at 128k of program memory and 64 pins. Supported by Spence Konde's core.

I'm rather fond of the SAMD51, as used in Adafruit's "Grand Central Station" board. (But: 3.3V.) Supported in the Adafruit SAMD core.

Hmm. The Renesas RA4M cpu is available in a 100 pin package, so that's an interesting possibility. There's already an Uno R4 and Nano, perhaps there is a Mega Replacement in the works as well? It's 5V, but ARM, and still "young" in terms of library support, and there are a bunch of things I don't like about the chip, the Renesas documentation, the Core implementation; but it's an interesting possibility.

See post #2.

Note that the ESP32 chips max out at far fewer GPIOs than a mega2560, and I think some of those need to be dedicated to the flash interface and such...
(The S3, which has the max GPIOs till you hit the less popular P series, is in a 56pin package.)

Indeed, I've seen many ESP32 implementations that seemed to max out at fewer useful pins than a classic Nano; add to that the 3.3V hassles, and I'm not overly impressed. Sure, if I needed the Mega's I/O but ESP32's compute speed, or a graphics interface, or a camera, or wanted to sloppy-code without worrying about memory usage, I might opt to custom up a '32 with a few 16-bit interface adaptors, but it hasn't happened so far.

I have to look at those. Are they fully compatible with Arduino SW, then. I think 128k is enough

" I'm rather fond of the SAMD51, as used in Adafruit's "Grand Central Station" board. (But: 3.3V.) Supported in the Adafruit SAMD core."
This is interesting
I have to look at the schematics. I already have had to do some 3.3V, so it is not a "show stopper", a bit of nuisance is the word I think.
Thanks

I read at one manufacturers Arm forum scary tales of bad documentation and lacking support. But I managed to make a STM32H750 board work. But I am a lazy programmer. And making drivers to every peripheral chip and board is not fun when there is Arduino support already done.

Mouser don't even appear to stock these any more.

Another suggestion is the ATMEGA4809 as used in the Nano Every. You'd need then a UPDI programmer.

No, it way far away from it.
As was previously mentioned, there is no board that fully suit s your requests. It is extremely hard to find a board with mcu fully compatible with classic AVR code and a pinout, suit to use a mega shields.

If original Mega is too costly for you, I would to see on clones on AliExpress. There are Mega 2560 clones for only $10-12.

When you need "Arduino Support" go for the ESP32. If you need more IOs use port expanders.

moved from PIC24/dsPIC/PIC32 and STM32s to ESP32 some years back
depending on product volume make

  1. custom PCBs with onboard ESP32/ESP32S3 plus sensors etc
  2. use a ESP32 dev board as a daughter board on a custom PCB which has the sensors etc

currently looking at using a Heltec LoRa32 V3 which has onboard LoRa and OLED as a PCB daughter board on a water monitoring project

EDIT: have not used a 5V logic microcontroller in a commercial or research project for over 30 years - probably the last was a MC68020

as well as 3.3V logic some of the latest PCBs are using 1.8V logic devices

They are approximately as compatible as the ATmega4809 in the Nano Every and Uno WiFi 2. That means, not "completely compatible", but closer than any non-AVR board.

In particular, all AVRs ATmega4809 and newer have gone to structure-based IO Register definitions, so any old "bare metal" code that did PORTB |= 1<<4 will now need to do something like VPORTB->OUT |= 1<<4 instead.
Some Arduino libraries are optimized to use such bare-metal programming, and some percentage of those not have been updated for the newer AVRs (or any other newer chips, either.) Arduino has been around for about 18 years now, and there are a bunch of libraries that have been abandoned as enthusiastic youngsters have "moved on", or older contributors have passed on. :frowning:

You would have to do "due diligence" to see if the libraries you are interested in using are compatible with whatever processor you use. (For that matter, not all Uno (ATmega328 or earlier) libraries are compatible with the ATmega2560...)

To my honest opinion, nowadays 5V hassles are superior to 3.3V hassles... Hassle it remains though :wink:

Modern R4 Arduino boards now have the Renesas RA4FM on them. They do have plenty of GPIOs - more than are actually presented on the Nano or UNO, although slightly fewer (I think) than on the 2560. These do run at 3.3V and as per the above, their register configuration is different to the original AVR architecture and the GPIO characteristics are different so if low level hardware programming is required, then again due diligence will be required to check compatibility.

Interesting. Can you tell more about the library support and the chip it self. What Arduino boards have them? I have to check that out. BGA is a problem, I have not yet made a PCB for those kind chips.