0

I decided to learn Arduino in this quarantine so I am still a newbie when it comes to micro controllers. Basically I been doing all my projects based on the ATMEGA328P-PU:

enter image description here

I even converted my breadboard designs to custom PCBs like this one:

enter image description here

I am running out of Atmega328P-PU processors and I am about to buy more. But instead of going with the traditional Atmega328P should I buy other processors?

This are my alternatives:

enter image description here

enter image description here


They all are about the same price. For example the ESP32 is 10 times faster and it was a lot more sram and pins. Anyways this are my questions:

  1. Why do people buy the Atmega328P when there are faster and more powerfull processors for the same price?

  2. I been saving a lot of money by buying the Atmega328P processor by itself and then building Arduino using the crystal, ceramic capacitors etc. There are so many tutorials on how to build that such as on THIS LINK and many more. But how can I build an ESP32 running arduino code on a breadboard? I have not been able to find that tutorial. All the tutorials I find use the ESP32 already soldered to a PCB. I want to build my custom PCB using a ESP32 for example. Where can I find that tutorial?

  3. If I decide to buy the ESP32 or ESP8266 should I build my code using the arduino IDE? I will have to add stuff to arduino IDE so it works with the ESP32. What are the benefits of using other IDEs?

  4. I am thinking about the ESP32 and ESP8266 because I see a lot of people using them on the internet and they are much more powerfull than the Atmega328P for the same price. What other processors do you guys recommend?

3
  • 1
    did you see Teensy 4?
    – Juraj
    Aug 14, 2020 at 16:40
  • 2
    Forget the esp8266. The IO is to restrictive. ESP32 if far far better.
    – Majenko
    Aug 14, 2020 at 18:05
  • 1
    I love the 8266, mostly because of the price and the esp-01's size. ESP's don't really do breadboards. If you want small and cheap, look for "wroom esp32" modules, but keep in mind the pin spacing is unlike breadboards. I use 10cm M+F dupont cables to run from MCU pins to breadboards. The nodeMCU boards have so many vcc+gnd pins that I can often "dead bug" sensors and outputs w/o a breadboard or pcb using F+F dupont cables. I would look into the "blue pill" arm boards, which now have official arduino support. Lastly, there's a way to run a 328 w/o a crystal, at 8Mhz, might interest you.
    – dandavis
    Aug 14, 2020 at 21:23

2 Answers 2

1

For learning it really doesn't matter much of which MCU to choose from. For actually embedded project development, it really depends on what you want to do with your dev board. I thought that I would just offers some of my thoughts and experiences here as a reference, there is no right or wrong answers. I'm sure many people have their own favourites and considerations when picking their MCU.

Why do people buy the Atmega328P when there are faster and more powerfull processors for the same price?

ATmega328p get popular for its long history (it is 2-decades old) and Arduino, personally I feel that there are better MCU with compatible features, memory size, etc. even within the AVR series to replace ATmega328p, I actually developed an ATtiny3217-based Arduino board last month, it is cheaper (on chip BOM cost) and it does not need crystal for running at 20MHz with decent accuracy, it offers almost similar I/O pins, memory size, UART/I2C/SPI as ATmega328, but it is a much modern chip with many features that are not available in ATmega328 (such as DAC, touch support, event system, etc.). ATmega3208/4809 is another interesting candidate for my next project.

All the tutorials I find use the ESP32 already soldered to a PCB. I want to build my custom PCB using a ESP32 for example. Where can I find that tutorial?

ESP32 (and ESP8266 like ESP-12F as well) come with a compact form factor that is ready to be integrated into your design, most of the design needs are USB-interface, power supply and some peripheral (such as auto-reset circuitry, power and blinking LEDs, etc.). You can take a look at Adafruit HUZZAH ESP8266 which is basically based upon an ESP-12E module with added circuit for reset, voltage regulator.

If I decide to buy the ESP32 or ESP8266 should I build my code using the arduino IDE? I will have to add stuff to arduino IDE so it works with the ESP32. What are the benefits of using other IDEs?

Arduino IDE is not the only IDE for programming an Arduino, PlatformIO is one of the alternatives IDE for Arduino programming, one of the main benefits is better project and dependency(libraries) management and the flexibility on compiling/building process (e.g. pull in the floating point supports on AVR chips). Take a look at these two YouTube videos to see how it looks like and how to set it up:

I am thinking about the ESP32 and ESP8266... What other processors do you guys recommend?

As I mentioned at the beginning, it really depend on your selection criteria. ESP8266 and ESP32 is generally the choice for its WiFi capability, however, you won't chose ESP8266 for anything related to ADC because it has only one ADC with a reference voltage of 1v. ESP32 looks great for for its faster CPU, it however generated a lot of noise when you want to reading sensor data even though it offers 12-bit ADC resolution versus 10-bit in ATmega328p. Its ADC also has non-linear issue on some of the old batch of ESP32 chips.

On the question of "what other processors do you guys recommend"? If no requirements for wireless connectivity, I personally like STM32F103 Blue Pill, for its better ADC (12-bit), more memory, and multiple UARTs, and cheap but there are things that you need to be aware of (such as fake STM32 chip and design faults).

Whatever you decided for your next choice of MCU, I'm sure it won't be your last one, as your experience grow and your project get more complex, you will know that there is no perfect MCU that fit it all.

1
  1. Sometimes faster and more powerful is not needed. If you just needed a simple timer, and it needed to be battery operated, a processor like the ATmega328 would be the better choice. It really depends on the application.

The ESP32 is a great device. But the A/D converter on it is less than stellar. It is not as consistent compared to the A/D in the Atmega328P.

  1. The ESP32 is more fussy about the power supply requirements compared to the Atmega328P. Lots of people get themselves into trouble when they use poor design practices with the ESP32/ESP8266 modules. Poor practices that worked well enough for lower power and lower speed processors like the Atmega328P. Most people don't bother with reading the datasheet for the processors. They just try and copy stuff they fine on the Internet. And the Internet is full of poor quality information by people who don't really understand much of what they are working with.

If you want to start using the ESP32, then do yourself a favor and buy a working board with a power supply and not just buy a module. It will save you many hours of grief.

  1. The Arduino IDE makes it easy to get stuff working. There also is Python, but it is less popular. There is a lot more information available for the Arduino IDE, and available libraries. And that makes development a lot easier. There are other ways, but the learning curve is much steeper.

  2. The "Blue Pill" STM32F103C8T6 based board is a lot of capability for little money. The CPU runs on 3.3 volts like the ESP devices. It has gain a lot of popularity in the last few years but there isn't as much information as for the Atmega328P.

The STM32F103C8T6 and the ESP devices are 3.3 volt based designs. And they require 3.3 volt devices to interact with. There are some devices that are mostly 5 volt only devices. Like a character LCD. It is easier to interface that to a 5 volt processor.

There is lots that I could still say but it would take hours. But what you should do before deciding on a part is to decide what the needs of the project are. That will often guide you towards the part you should use.

One more note. The ESP devices are running a lot of code on top of the Setup and Loop functions. There is lots of stuff going on in the background to support the WiFi capability. And you don't have the kind of control that you could have with a non-ESP device. But if you want that part then you need to accept that limitation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.