ATmega328P
   HOME

TheInfoList



OR:

The ATmega328 is a single-
chip Chip may refer to: Food * Chip (snack), thinly sliced and deep-fried gastro item ** Potato chips (US) or crisp (UK) * Chips (fried potato strips) (UK) or french fries (US) (common as a takeout side) * Game chips, thin chip/French fries * Choco ...
microcontroller A microcontroller (MC, uC, or μC) or microcontroller unit (MCU) is a small computer on a single integrated circuit. A microcontroller contains one or more CPUs (processor cores) along with memory and programmable input/output peripherals. Pro ...
created by Atmel in the megaAVR family (later
Microchip Technology Microchip Technology Incorporated is a publicly listed American semiconductor corporation that manufactures microcontroller, mixed-signal, analog, and Flash-IP integrated circuits. Its corporate headquarters is located in Chandler, Arizona. ...
acquired Atmel in 2016). It has a
modified Harvard architecture A modified Harvard architecture is a variation of the Harvard computer architecture that, unlike the pure Harvard architecture, allows memory that contains instructions to be accessed as data. Most modern computers that are documented as Harvar ...
8-bit In computer architecture, 8-bit integers or other data units are those that are 8 bits wide (1 octet). Also, 8-bit central processing unit (CPU) and arithmetic logic unit (ALU) architectures are those that are based on registers or data bu ...
RISC In electronics and computer science, a reduced instruction set computer (RISC) is a computer architecture designed to simplify the individual instructions given to the computer to accomplish tasks. Compared to the instructions given to a comp ...
processor core.


Specifications

The Atmel
8-bit In computer architecture, 8-bit integers or other data units are those that are 8 bits wide (1 octet). Also, 8-bit central processing unit (CPU) and arithmetic logic unit (ALU) architectures are those that are based on registers or data bu ...
AVR
RISC In electronics and computer science, a reduced instruction set computer (RISC) is a computer architecture designed to simplify the individual instructions given to the computer to accomplish tasks. Compared to the instructions given to a comp ...
-based microcontroller combines 32 KB
ISP An Internet service provider (ISP) is an organization that provides a myriad of services related to accessing, using, managing, or participating in the Internet. ISPs can be organized in various forms, such as commercial, community-owned, non ...
flash Flash, flashes, or FLASH may refer to: Arts, entertainment, and media Fictional aliases * The Flash, several DC Comics superheroes with super speed: ** Flash (Jay Garrick) ** Barry Allen ** Wally West, the first Kid Flash and third adult Flash ...
memory with read-while-write capabilities, 1 KB
EEPROM EEPROM or E2PROM (electrically erasable programmable read-only memory) is a type of non-volatile memory. It is used in computers, usually integrated in microcontrollers such as smart cards and remote keyless systems, or as a separate chip d ...
, 2 KB SRAM, 23 general-purpose I/O lines, 32 general-purpose working registers, 3 flexible timer/ counters with compare modes, internal and external
interrupt In digital computers, an interrupt (sometimes referred to as a trap) is a request for the processor to ''interrupt'' currently executing code (when permitted), so that the event can be processed in a timely manner. If the request is accepted ...
s, serial programmable
USART A universal synchronous and asynchronous receiver-transmitter (USART, programmable communications interface or PCI) is a type of a serial interface device that can be programmed to communicate asynchronously or synchronously. See universal asynchron ...
, a byte-oriented 2-wire serial interface, SPI serial port, 6-channel 10-bit A/D converter (8 channels in TQFP and
QFN Flat no-leads packages such as quad-flat no-leads (QFN''and dual-flat no-leads (DFN) physically and electrically connect integrated circuits to printed circuit boards. Flat no-leads, also known as micro leadframe (MLF) and SON (small-outline no l ...
/ MLF packages), programmable
watchdog timer A watchdog timer (WDT, or simply a ''watchdog''), sometimes called a ''computer operating properly timer'' (''COP timer''), is an electronic or software timer that is used to detect and recover from computer malfunctions. Watchdog timers are wide ...
with internal
oscillator Oscillation is the repetitive or periodic variation, typically in time, of some measure about a central value (often a point of equilibrium) or between two or more different states. Familiar examples of oscillation include a swinging pendulum ...
, 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.


Features


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. * ATmega328 * ATmega328P and ATmega328P-AUTOMOTIVE * ATmega328PB and ATmega328PB-AUTOMOTIVE (superset of ATmega328P) - has more UART, I2C, and SPI peripherals than ATmega328P


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 Arduino () is an Italian open-source hardware and open-source software, software company, project, and user community that designs and manufactures single-board microcontrollers and microcontroller kits for building digital devices. Its hardwar ...
development platform, namely the
Arduino Uno The Arduino Uno is a series of open-source Single-board microcontroller, microcontroller board based on a diverse range of Microcontroller, microcontrollers (MCU). It was initially developed and released by Arduino company in 2010. The Single-bo ...
, Arduino Pro Mini and
Arduino Nano The Arduino Nano is an open-source breadboard-friendly Single-board microcontroller, microcontroller board based on the Microchip Technology, Microchip ATmega328P microcontroller (MCU) and developed by Arduino, Arduino.cc and initially released i ...
models.


Programming

Reliability qualification shows that the projected data retention failure rate is much less than over 20 years at 85 °C or 100 years at 25 °C. Programming mode is entered when PAGEL (PD7), XA1 (PD6), XA0 (PD5), BS1 (PD4) is set to zero. 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. Set XA1:XA0:BS1:DATA = , 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 = , XTAL1 pulse, pulse WR to zero. This is the flash write command. And so on. 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.


See also

* ATmega88 *
AVR microcontrollers AVR is a family of microcontrollers developed since 1996 by Atmel, acquired by Microchip Technology in 2016. They are 8-bit RISC single-chip microcontrollers based on a modified Harvard architecture. AVR was one of the first microcontrolle ...
* Atmel AVR instruction set *
ATtiny microcontroller comparison chart ATtiny (also known as TinyAVR) is a subfamily of the popular 8-bit AVR microcontrollers, 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 ...
* In-system programming


References

{{Reflist


External links

; Official webpages
ATmega328
- Microchip
ATmega328P
- Microchip
ATmega328PB
- Microchip Atmel microcontrollers