ATmega328

Last updated
ATmega328P in 28-pin narrow dual in-line package (DIP-28N) ATMEGA328P-PU.jpg
ATmega328P in 28-pin narrow dual in-line package (DIP-28N)
ATmega328P in 32-pin thin quad flat pack (TQFP-32) ICIC-TQ32-X-K328-01 (16421989932).jpg
ATmega328P in 32-pin thin quad flat pack (TQFP-32)
Die of ATmega328P ATMEL MEGA328P AU 1328.jpg
Die of ATmega328P

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.

Contents

Specifications

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, 3 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 5 software-selectable power-saving modes. The device operates between 1.8 and 5.5 volts. The device achieves throughput approaching 1  MIPS/MHz. [1]

Features

ParameterValue
CPU type8-bit AVR
Maximum CPU speed20 MHz
Performance20 MIPS at 20 MHz [2]
Flash memory 32 KB
SRAM 2 KB
EEPROM 1 KB
Package pin count28 or 32
Capacitive touch sensing channels16
Maximum I/O pins23
External interrupts3
USB interfaceNo

Family

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. [3]

Applications

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, Arduino Pro Mini [4] and Arduino Nano models.

Programming

Pinout of ATmega 48A/PA/88A/PA/168A/PA/328/P in 28-PDIP (datasheet) ATmega328P 28-PDIP.svg
Pinout of ATmega 48A/PA/88A/PA/168A/PA/328/P in 28-PDIP (datasheet)

Reliability qualification shows that the projected data retention failure rate is much less than 1 PPM over 20 years at 85 °C or 100 years at 25 °C. [5]

Parallel program mode [2]
Programming signalPin NameI/OFunction
RDY/BSYPD1OHigh means the MCU is ready for a new command, otherwise busy.
OEPD2IOutput enable (active low)
WRPD3IWrite pulse (active low)
BS1PD4IByte select 1 ("0" = Low byte, "1" = High byte)
XA0PD5IXTAL action bit 0
XA1PD6IXTAL action bit 1
PAGELPD7IProgram memory and EEPROM data page load
BS2PC2IByte select 2 ("0" = low byte, "1" = 2nd high byte)
DATAPC[1:0]:PB[5:0]I/OBi-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. [2] RESET pin to 0 V and VCC to 0 V. VCC is set to 4.5–5.5 V. Wait 60 μs, and RESET is set to 11.5–12.5 V. Wait more than 310 μs. [2] 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. [2] And so on.

Serial programming [2]
SymbolPinsI/ODescription
MOSIPB3ISerial data in
MISOPB4OSerial Data out
SCKPB5ISerial Clock

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. [2]

See also

Related Research Articles

<span class="mw-page-title-main">Microcontroller</span> Small computer on a single integrated circuit

A microcontroller or microcontroller unit (MCU) is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs along with memory and programmable input/output peripherals. Program memory in the form of NOR flash, OTP ROM or ferroelectric RAM is also often included on chip, as well as a small amount of RAM. Microcontrollers are designed for embedded applications, in contrast to the microprocessors used in personal computers or other general purpose applications consisting of various discrete chips.

<span class="mw-page-title-main">MCS-51</span> Single chip microcontroller series by Intel

The Intel MCS-51 is a single chip microcontroller (MCU) series developed by Intel in 1980 for use in embedded systems. The architect of the Intel MCS-51 instruction set was John H. Wharton. Intel's original versions were popular in the 1980s and early 1990s, and enhanced binary compatible derivatives remain popular today. It is a complex instruction set computer, but also has some of the features of RISC architectures, such as a large register set and register windows, and has separate memory spaces for program instructions and data.

<span class="mw-page-title-main">AVR microcontrollers</span> Family of microcontrollers

AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology in 2016. These are modified Harvard architecture 8-bit RISC single-chip microcontrollers. AVR was one of the first microcontroller families to use on-chip flash memory for program storage, as opposed to one-time programmable ROM, EPROM, or EEPROM used by other microcontrollers at the time.

Atmel Corporation was a creator and manufacturer of semiconductors before being subsumed by Microchip Technology in 2016. Atmel was founded in 1984. The company focused on embedded systems built around microcontrollers. Its products included microcontrollers radio-frequency (RF) devices including Wi-Fi, EEPROM, and flash memory devices, symmetric and asymmetric security chips, touch sensors and controllers, and application-specific products. Atmel supplies its devices as standard products, application-specific integrated circuits (ASICs), or application-specific standard product (ASSPs) depending on the requirements of its customers.

<span class="mw-page-title-main">PIC microcontrollers</span> Line of single-chip microprocessors from Microchip Technology

PIC is a family of microcontrollers made by Microchip Technology, derived from the PIC1640 originally developed by General Instrument's Microelectronics Division. The name PIC initially referred to Peripheral Interface Controller, and is currently expanded as Programmable Intelligent Computer. The first parts of the family were available in 1976; by 2013 the company had shipped more than twelve billion individual parts, used in a wide variety of embedded systems.

<span class="mw-page-title-main">Atmel AT89 series</span> Intel 8051-compatible family of 8 bit microcontrollers

The Atmel AT89 series is an Intel 8051-compatible family of 8 bit microcontrollers (μCs) manufactured by the Atmel Corporation.

Atmel ARM-based processors are microcontrollers and microprocessors integrated circuits, by Microchip Technology, that are based on various 32-bit ARM processor cores, with in-house designed peripherals and tool support.

<span class="mw-page-title-main">AVR32</span>

AVR32 is a 32-bit RISC microcontroller architecture produced by Atmel. The microcontroller architecture was designed by a handful of people educated at the Norwegian University of Science and Technology, including lead designer Øyvind Strøm and CPU architect Erik Renno in Atmel's Norwegian design center.

Microchip Technology Incorporated is a publicly listed American corporation that manufactures microcontroller, mixed-signal, analog, and Flash-IP integrated circuits. Its products include microcontrollers, Serial EEPROM devices, Serial SRAM devices, embedded security devices, radio frequency (RF) devices, thermal, power, and battery management analog devices, as well as linear, interface and wireless products.

<span class="mw-page-title-main">Arduino</span> Italian open-source hardware and software company

Arduino is an Italian open-source hardware and software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Its hardware products are licensed under a CC BY-SA license, while the software is licensed under the GNU Lesser General Public License (LGPL) or the GNU General Public License (GPL), permitting the manufacture of Arduino boards and software distribution by anyone. Arduino boards are available commercially from the official website or through authorized distributors.

<span class="mw-page-title-main">DataFlash</span> Flash memory

DataFlash is a low pin-count serial interface for flash memory. It was developed as an Atmel proprietary interface, compatible with the SPI standard. In October 2012, the AT45 series DataFlash product lines, related intellectual property, and supporting employee teams were purchased by Adesto Technologies.

<span class="mw-page-title-main">PICkit</span>

PICkit is a family of programmers for PIC microcontrollers made by Microchip Technology. They are used to program and debug microcontrollers, as well as program EEPROM. Some models may also feature logic analyzers and serial communications (UART) tools.

<span class="mw-page-title-main">ATmega88</span>

The ATmega88 is an electronic integrated circuit microcontroller produced by the Atmel corporation. It has the basic Atmel AVR instruction set. One of the packaging configurations is the dual in-line package (DIP). It has 23 I/O pins and operates at up to 20 MHz for clock speed. It has an 8-bit core and 8K flash (program) memory.

OBDuino is an open source trip computer design based on the Arduino platform. An OBDuino may be assembled and customised by an electronics hobbyist; it displays information such as instantaneous fuel economy, engine tuning parameters etc. on an LCD.

debugWIRE is a serial communications protocol, designed by Atmel. It is used for on-chip debugging of AVR microcontrollers.

<span class="mw-page-title-main">ATtiny microcontroller comparison chart</span> Subfamily of 8-bit AVR microcontrollers

ATtiny is a subfamily of the popular 8-bit AVR microcontrollers, which typically has fewer features, fewer I/O pins, and less memory than other AVR series chips. The first members of this family were released in 1999 by Atmel.

<span class="mw-page-title-main">Arduino Uno</span> Microcontroller board

The Arduino Uno is an open-source microcontroller board based on the Microchip ATmega328P microcontroller (MCU) and developed by Arduino.cc and initially released in 2010. The microcontroller board is equipped with sets of digital and analog input/output (I/O) pins that may be interfaced to various expansion boards (shields) and other circuits. The board has 14 digital I/O pins, 6 analog I/O pins, and is programmable with the Arduino IDE, via a type B USB cable. It can be powered by a USB cable or a barrel connector that accepts voltages between 7 and 20 volts, such as a rectangular 9-volt battery. It has the same microcontroller as the Arduino Nano board, and the same headers as the Leonardo board. The hardware reference design is distributed under a Creative Commons Attribution Share-Alike 2.5 license and is available on the Arduino website. Layout and production files for some versions of the hardware are also available.

<span class="mw-page-title-main">Arduino Nano</span> Single-board microcontroller

The Arduino Nano is an open-source breadboard-friendly microcontroller board based on the Microchip ATmega328P microcontroller (MCU) and developed by Arduino.cc and initially released in 2008. It offers the same connectivity and specs of the Arduino Uno board in a smaller form factor.

References

  1. "ATmega328P" . Retrieved 2016-07-14.
  2. 1 2 3 4 5 6 7 "Atmel 8-bit AVR Microcontrollers ATmega328/P Datasheet Complete" (PDF). Retrieved 2016-07-14.
  3. "megaAVR Microcontrollers". Atmel. Retrieved 2016-07-14.
  4. "Arduino - ArduinoBoardProMini". www.arduino.cc. Retrieved 2021-12-08.
  5. "Atmel 8-bit AVR Microcontrollers ATmega328/P Datasheet Summary" (PDF). June 2016. Retrieved 2016-07-14.
Official webpages