Introduction to ATmega328P Microcontroller

The ATmega328P is an 8-bit microcontroller based on the AVR Architecture. While Atmel originally developed this microcontroller, it is now part of the Microchip Technology. This IC is very famous for being the main microcontroller in several Arduino Boards such as the Arduino UNO, Arduino Nano (currently in production) and Arduino Pro Mini (retired). It has 131 instructions, most of which execute in a single clock cycle. So, with its 16MHz clock frequency, you can expect a throughput of nearly 16 MIPS from ATmega328P (as it has 1 MIPS/MHz throughput). Memory wise, it has 32KB of Flash Memory, 2KB SRAM and 1KB EEPROM. We will see some other specifications in the next section.

Important Specifications of ATmega328P

We have already seen couple of important specifications of ATmega328P in the previous section. Here are some more specifications for your reference.

8-Bit AVR Microcontroller Modified Harvard RISC Architecture 32KB Flash Memory 1KB EEPROM 2KB SRAM Two 8-bit Timer/Counters One 16-bit Timer/Counter Six PWM Channels Eight 10-Bit ADC Channels in 32-lead QFP and 32-pad QFN Packages Six 10-Bit ADC Channels in 28-pin DIP and 28-pad QFN Packages USART, SPI and I2C Interfaces Watchdog Timer, Pin Change Interrupt and Wake-up Power-on Reset, Internal and External Interrupts Operating Voltage:1.8V to 5.5V for 0 – 4MHz, 2.7V to 5.5V for 0 – 10MHz and 4.5V to 5.5V for 0 – 20MHz speed grades. Active Mode Power Consumption of 0.2mA at 1.8V and 1MHz Power Down Mode Consumption of 0.1µA at 1.8V and 1MHz

As always, these specifications are just for reference only. For more in-depth details on all the specifications, we suggest you to go through the datasheet.

ATmega328P Pinout and IC Packages

The ATmega328P is available in 4 IC Packages. The pinout and pin configuration slightly vary between the packages.

32-Lead TQFP (Thin Quad Flat Pack with Leads) 28-Pin SPDIP (Shrink Plastic Dual In-Line Package) 32-Pad VQFN (Very Thin Quad Flat No-Leads) 28-Pad VQFN (also known as MLF – Micro Lead Frame)

In the following image, we put out all the four packages of ATmega328P. The image also shows the ATmega328P Pinout of all the packages.

An important point to note here is that the ATmega328P Pinout for each package is different i.e., Pin 1 in 28-pin DIP is PC6 while it is PD3 in 32-lead Quad Flat Package. So, keep an eye on the package you are using and understand its pinout properly. Also, both the 32-lead QFP and 32-pad QFN packages have same pinouts. The main difference between all these packages is that the 32-pin packages (QFP and QFN) have two additional ADC Channels (ADC6 and ADC7) than the 28-pin packages (DIP and QFN), which have only 6 ADC Channels (ADC0 to ADC5). Other than this, rest of the pins and their alternative functions are same.

ATmega328P Pin Description

Let us now see the pin description of ATmega328P. For this section, we will use the 32-Pin QFP package as reference. So, in the following table, when we say “Pin 1”, this only refers to 32-Pin QFP package of ATmega328P only. For other packages, the pin number might change, but the pin names, alternate functions and the overall pin description will remain the same.

Conclusion

ATmega328P is the microcontroller on the Arduino UNO Board. So, it is very important to understand the specifications and features of this IC. As Arduino is an open-source platform, you can design your own boards if you have all the information regarding the IC. One crucial data is the ATmega328P Pinout for different IC Packages. We saw images of ATmega328P IC Packages along with their pinouts. There is also a pin description with respective alternate functions. Pin Change Interrupt 19 USART External Clock Input/Output, Pin Change Interrupt 20 Pin Change Interrupt 6 Timer Oscillator Pin 2, Pin Change Interrupt 7 Pin Change Interrupt 21 Timer/Counter0 Output Compare Match A Output, Pin Change Interrupt 22 Divided System Clock Output, Pin Change Interrupt 0 SPI Slave Select Pin, Pin Change Interrupt 2 Pin Change Interrupt 3 Pin Change Interrupt 4 Pin Change Interrupt 9 Pin Change Interrupt 11 Pin Change Interrupt 12 I2C Serial Clock, Pin Change Interrupt 13 Pin Change Interrupt 16 Pin Change Interrupt 18 Comment * Name * Email * Website

Δ

ATmega328P Pinout   IC Packages  Pinouts and Pin Description - 57ATmega328P Pinout   IC Packages  Pinouts and Pin Description - 14ATmega328P Pinout   IC Packages  Pinouts and Pin Description - 2ATmega328P Pinout   IC Packages  Pinouts and Pin Description - 31ATmega328P Pinout   IC Packages  Pinouts and Pin Description - 80ATmega328P Pinout   IC Packages  Pinouts and Pin Description - 12ATmega328P Pinout   IC Packages  Pinouts and Pin Description - 78