I like the Arduino Micro and the Arduino Uno. They are simple to use, and the Micro is small enough to fit into a lot of projects. But they are still a little large to imbed into some smaller projects, and they are expensive! In most cases, an Arduino has more parts than needed for a project. The main part is the microcontroller itself, the Atmel 328. The rest is just fluff, like a linear voltage regulator, a USB port, a USB to serial converter chip, and the worst part is the bulky pin headers! My solution is to imbed the Atmel 328PB microcontroller into my PCB. This was not easy to figure out, so in this tutorial I’ll demonstrate everything you need to know to imbed the 328PB into your own projects. For an example of how to use this microconrtroller, check out my HDSP clock HERE.


The Atmel 328PB (Left.) Click for jumbo size. The Atmel328PB pinout when used with Minicore (Right.)
328 VS 328 PB
The Arduino Uno and Micro (and probably others) use the Atmel 328 microcontroller. This is an excellent microcontroller. The main advantage that I see to the 328 is that it is available in a through hole DIP package, so it can be placed in a pin socket and re used. I discovered that the Atmel 328PB is similar to the 328, but it has a handful of advantages that make it very attractive. The best part is that it’s cheaper than the 328. I think you can get them directly from Microchip for around $1 each. That’s pretty hard to beat! On the 328, pins 3 and 6 are power pins. But on the 328PB they are two more GPIO pins! The only real downfall to the 328PB that I see is that it is only available in surface mount packages. In particular, I like the 328PB-AU, because it comes in a TQFP-32 package that’s pretty easy to hand solder. The 328PB has a built in 8 Mhz oscillator that I use in all of my projects. You can use a, external oscilator, but I’ve never had a need to do this. By skipping it, I can make my projects smaller and avoid adding those components to the BOM.
Mini Core
To flash your program to the 328PB in the Arduino IDE, you’ll need to add a third party board to the Arduino IDE called Mini Core that you can download on GitHub. Mini Core is neat because it allows you to flash a whole bunch of chips like the 328PB, and the 328 among others from the comfort of the Arduino IDE. You’ll notice that you will have a bunch of new options in the Tools menu where you can select other clock speeds with an internal or external oscilator.
Make a Flasher Tool
When you flash a sketch to an Arduino Uno, it plugs directly into USB on your computer. There’s a USB to serial converter chip built into Arduinos that makes this work. To flash a standalone 328PB, we’ll use this USB to serial converter chip in a totally seperate Arduino. I call this my “flasher tool”. All that’s required to make a flasher tool is an Arduino Uno and some Dupont header wires! I suggest spending a little extra and getting an authentic Arduino Uno for this, or at least get a clone from a reputable source. I’m pretty sure a lot of the cheaper clones use counterfit chips and I’ve seen some odd behavior from them that makes them unusable for this purpose. If you navigate to the example sketches in the Arduino IDE, you’ll notice an example sketch called ArduinoISP. Open it up and flash it to your Uno. You only have to do this once. Inside of this sketch is instructions for connecting your flasher tool to the target microcontroller that are pretty intuitive. The ICSP header connects to the matching pins on the target microcontroller, and Pin 10 connects to the target’s reset pin.



These are my flasher tools. Above is a flasher tool for flashing an unsoldered 328PB TQFP-32 surface mount chip. I added a pin header so it can also be used to flash chips that have already been soldered, but I haven’t had a need to use it. The circuit is pretty simple. I’ll include the PCB files in a link below if you want to make it. You’ll need to get a TQFP-32 socket. I got mine from eBay. To the right is a more basic flasher tool with nothing more than an Arduino Uno and some Dupont wires.
Here’s the schematic, BOM, and PCB to make your own flasher tool with a socket for flashing un-soldered 328PB chips.
Flashing a Chip
Once you’ve got your flasher tool flashed with the ArduinoISP sketch, you’re ready to flash your 328PB. There’s a handful of settings to click in the Arduino IDE. I’ll go through them step by step
- Select the correct port under tools. Go to Tools , Port. You’ll see a handful of ports to choose from. Un-plug your flasher tool, and look at this list. Plug in your flasher tool, and you’ll see you have a new port. Choose that port.
- Next, choose your “board.” go to Tools, Board, Mini Core, Atmega328
- Choose your clock. I suggest using the internal clock, unless you want to add an external clock to your design for some reason. Go to: Tools, Clock, Internal 8Mhz, or whatever external clock you are using.
- select the 328PB: Go to Tools, Variant, 328PB.
- Select the programmer: Go to Tools, Programmer, Arduino as ISP.
- Burn the bootloader. Go to Tools, Burn bootloader. You only need to do this once for each new 328PB.
Now you’re ready to flash a sketch. Go to Sketch, Upload Using Programmer If you hit that usual upload button, you will upload your sketch to the flasher tool and you’ll need to re flash the ArduinoISP sketch.
Incorporating the 328PB into your design
Incorporating the 328PB is pretty straightforward. I like to add a 6 pin Dupont header on my PCBs right next to the microcontroller so that I can easily flash a new firmware. I think the RST pin needs to be pulled high with a 1KΩ resistor, but it seems to work fine whithout this. You’ll want to reference the pinout for the 328PB on the Minicore Github when assigning pins. Don’t forget to include a few capacitors near the microcontroller. I like to use a 100μF and a 100nF cap and this seems to work. Below is an example from a schematic of one of my clocks. Notice that the nets on the 6 pin header are all tied to their respective pins on the 328PB. The rest of the 328PB pins are fair game, but you probably won’t have much luck using these pins for anything else.


