Definitely! You might also find the ATmega1284P to be an interesting candidate. It is available in a DIP package and has excellent Arduino support via the "MightyCore boards platform. This is useful for projects where you need more I/O pins or more memory than the ATmega328P can provide.
The price of the chip is significantly higher, but for one-off projects an extra $5 in BOM might not be significant. In cases where it is and your project doesn't require so much memory, there are some other members of the ATmega1284P family also supported by MightyCore that are available for a bit less (I have found the ATmega32 for a quite reasonable price in the past).
Also definitely worth looking at the ATmega4809. This is one of the newer generation of AVR chips, so slightly less well supported by the Arduino ecosystem as a whole than the classic AVR chips, but this is the microcontroller on the Arduino Nano Every so it is in widespread use by the community. It has good resources at a reasonable price point for a DIP package Arduino compatible microcontroller. MCUdude comes to the rescue once again to add comprehensive support for this chip through the excellent MegaCoreX boards platform.
If you put a factory fresh ATmega328P chip on the UNO board, you must connect an ISP programmer to the board and then do a "Burn Bootloader" operation in Arduino IDE in order to:
- Set the configuration fuses on the chip to the appropriate settings.
- Flash the bootloader that allows you to upload sketches via the UNO's USB cable as usual.
If you don't have a dedicated AVR ISP programmer, you can use a spare Arduino board as a DIY "Arduino as ISP" programmer:
You can actually upload sketches to the chip via the ISP programmer by selecting Sketch > Upload Programmer from the Arduino IDE menus, so the bootloader is optional, but setting the configuration fuses is not optional (unless the factory default fuse settings happen to meet your requirements, which is rare).
It is not mandatory. You can run the microcontroller from the internal clock source. You can configure the chip for this clock via MiniCore:
- If you haven't already, install MiniCore by following the instructions in the readme:
https://github.com/MCUdude/MiniCore#boards-manager-installation
- Select Tools > Board > MiniCore> ATmega328 from the Arduino IDE menus.
- Select Tools > Clock > Internal 8 MHz from the Arduino IDE menus.
- Connect an ISP programmer between the UNO board and the computer.
- Select the appropriate programmer from the Tools > Programmer menu in Arduino IDE.
- Select Tools > Burn Bootloader from the Arduino IDE menus.
This will configure the chip to run off the internal clock source. This means that when you pull it out of the UNO, you can use it in a project board that doesn't provide an external clock source. The internal clock is not as accurate, but it it good enough for many applications (there are actually some popular Arduino boards that use AVR microcontrollers running from the internal clock source).
The problem is that the socket is not really ideal for this application. It takes a fair bit of force to remove the chip and it tends to come loose very suddenly. If the pins come loose from one end of the socket before the other, the pins can become badly bent, which is inconvenient to realign and can cause them to break off if it happens multiple times.
But other than that, it is great. You can also use it with the other pin compatible chips in the family like ATmega168 and ATmega8 (which are also supported by MiniCore).
There are these "ATmega8 Minimum System" boards available from the online marketplaces:
They have a ZIF (zero insertion force) socket that is specifically designed for this application where chips will be inserted and removed from the socket frequently. The ATmega8 is pin compatible with the ATmega328P, so they work just as well for any of the chips of that family.
The boards (as well as the "ATmega32 Minimum System" variant for the DIP-40 chips) are quite reasonably priced (probably about the same as you would pay for the socket component alone). The crystal is in a machine header, which makes it easy to swap for other frequencies or remove for verifying the chip is running on the internal clock.
I wish they had a 2x3 ICSP header (which is the standard in the Arduino world) instead of the 2x5 header. I also wish they had an "FTDI" header to make it easy to connect a USB to serial adapter to the chip for communication or uploading via the bootloader. For a use case where those features are important, the UNO as platform might be more attractive.