The ATmega328 is a single-chip microcontroller created by Atmel in the megaAVR family (later Microchip Technology acquired Atmel in 2016). It has a modified Harvard architecture 8-bit RISC processor core.
The Atmel 8-bit AVR RISC-based microcontroller combines 32 KB ISP flash memory with read-while-write capabilities, 1 KB EEPROM, 2 KB SRAM, 23 general purpose I/O lines, 32 general purpose working registers, three flexible timer/counters with compare modes, internal and external interrupts, serial programmable USART, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8-channels in TQFP and QFN/MLF packages), programmable watchdog timer with internal oscillator, and five software selectable power saving modes. The device operates between 1.8-5.5 volts. The device achieves throughput approaching 1 MIPS per MHz.
|CPU type||8-bit AVR|
|Performance||20 MIPS at 20 MHz|
|Flash memory||32 KB|
|Pin count||28 or 32 pin: PDIP-28, MLF-28, TQFP-32, MLF-32|
|Maximum operating frequency||20 MHz|
|Number of touch channels||16|
|Hardware QTouch Acquisition||No|
|Maximum I/O pins||23|
A common alternative to the ATmega328 is the "picoPower" ATmega328P. A comprehensive list of all other members of the megaAVR series can be found on the Atmel website.
- ATmega328P and ATmega328P-AUTOMOTIVE
- ATmega328PB and ATmega328PB-AUTOMOTIVE (superset of ATmega328P)
- It has more UART, I2C and SPI Interfaces than ATmega328P
As of 2013 the ATmega328 is commonly used in many projects and autonomous systems where a simple, low-powered, low-cost micro-controller is needed. Perhaps the most common implementation of this chip is on the popular Arduino development platform, namely the Arduino Uno and Arduino Nano models.
|Programming signal||Pin Name||I/O||Function|
|RDY/BSY||PD1||O||High means the MCU is ready for a new command, otherwise busy.|
|OE||PD2||I||Output Enable (Active low)|
|WR||PD3||I||Write Pulse (Active low)|
|BS1||PD4||I||Byte Select 1 (“0” = Low byte, “1” = High byte)|
|XA0||PD5||I||XTAL Action bit 0|
|XA1||PD6||I||XTAL Action bit 1|
|PAGEL||PD7||I||Program memory and EEPROM Data Page Load|
|BS2||PC2||I||Byte Select 2 (“0” = Low byte, “1” = 2nd High byte)|
|DATA||PC[1:0]:PB[5:0]||I/O||Bi-directional data bus (Output when OE is low)|
Programming mode is entered when PAGEL (PD7), XA1 (PD6), XA0 (PD5), BS1 (PD4) is set to zero. RESET pin to 0V and VCC to 0V. VCC is set to 4.5 - 5.5V. Wait 60 μs, and RESET is set to 11.5 - 12.5 V. Wait more than 310 μs. Set XA1:XA0:BS1:DATA = 100 1000 0000, pulse XTAL1 for at least 150 ns, pulse WR to zero. This starts the Chip Erase. Wait until RDY/BSY (PD1) goes high. XA1:XA0:BS1:DATA = 100 0001 0000, XTAL1 pulse, pulse WR to zero. This is the Flash write command. And so on..
|MOSI||PB3||I||Serial data in|
|MISO||PB4||O||Serial Data out|
Serial data to the MCU is clocked on the rising edge and data from the MCU is clocked on the falling edge. Power is applied to VCC while RESET and SCK are set to zero. Wait for at least 20 ms and then the Programming Enable serial instruction 0xAC, 0x53, 0x00, 0x00 is sent to the MOSI pin. The second byte (0x53) will be echoed back by the MCU.
- AVR microcontrollers
- Atmel AVR instruction set
- ATtiny microcontroller comparison chart
- In-system programming
- "ATmega328P". Retrieved 2016-07-14.
- "Atmel 8-bit AVR Microcontrollers ATmega328/P Datasheet Complete" (PDF). Retrieved 2016-07-14.
- "megaAVR Microcontrollers". Atmel. Retrieved 2016-07-14.
- Patil, Nikhil. "ATmega328PB based Arduino Uno". noobtronics.ltd. Retrieved 13 September 2019.
- "Atmel 8-bit AVR Microcontrollers ATmega328/P Datasheet Summary" (PDF). June 2016. Retrieved 2016-07-14.
- Official webpages