ATmega328P
8-bit AVR Microcontroller with 32K Bytes In-System Programmable Flash
Manufacturer
microchip
Overview
Part: Atmel ATmega328P
Type: 8-bit AVR Microcontroller
Key Specs:
- Flash Program Memory: 32K bytes
- EEPROM: 1Kbytes
- Internal SRAM: 2Kbytes
- Max Throughput: 16MIPS at 16MHz
- Operating Voltage: 2.7V to 5.5V
- Temperature Range: –40°C to +125°C
- Programmable I/O Lines: 23
- ADC: 8-channel 10-bit
- Active Mode Current: 1.5mA at 3V 4MHz
- Power-down Mode Current: 1µA at 3V
Features:
- High performance, low power AVR® 8-bit microcontroller
- Advanced RISC architecture
- 131 powerful instructions most single clock cycle execution
- 32 8 general purpose working registers
- Fully static operation
- On-chip 2-cycle multiplier
- High endurance non-volatile memory segments
- Write/erase cycles: 10,000 flash/100,000 EEPROM
- Optional boot code section with independent lock bits
- In-system programming by on-chip boot program
- True read-while-write operation
- Programming lock for software security
- Two 8-bit Timer/Counters with separate prescaler and compare mode
- One 16-bit Timer/Counter with separate prescaler, compare mode, and capture mode
- Real time counter with separate oscillator
- Six PWM channels
- Temperature measurement
- Programmable serial USART
- Master/slave SPI serial interface
- Byte-oriented 2-wire serial interface (Phillips I²C compatible)
- Programmable watchdog timer with separate on-chip oscillator
- On-chip analog comparator
- Interrupt and wake-up on pin change
- Power-on reset and programmable brown-out detection
- Internal calibrated oscillator
- External and internal interrupt sources
- Six sleep modes: Idle, ADC noise reduction, power-save, power-down, standby, and extended standby
Applications:
- Automotive
Package:
- 32-lead TQFP
- 32-pad QFN/MLF
Features
-
High performance, low power AVR® 8-bit microcontroller
-
Advanced RISC architecture
- 131 powerful instructions most single clock cycle execution
- 32 8 general purpose working registers
- Fully static operation
- Up to 16MIPS throughput at 16MHz
- On-chip 2-cycle multiplier
-
High endurance non-volatile memory segments
- 32K bytes of in-system self-programmable flash program memory
- 1Kbytes EEPROM
- 2Kbytes internal SRAM
- Write/erase cycles: 10,000 flash/100,000 EEPROM
- Optional boot code section with independent lock bits
- In-system programming by on-chip boot program
- True read-while-write operation
- Programming lock for software security
-
Peripheral features
- Two 8-bit Timer/Counters with separate prescaler and compare mode
- One 16-bit Timer/Counter with separate prescaler, compare mode, and capture mode
- Real time counter with separate oscillator
- Six PWM channels
- 8-channel 10-bit ADC in TQFP and QFN/MLF package
- Temperature measurement
- Programmable serial USART
- Master/slave SPI serial interface
- Byte-oriented 2-wire serial interface (Phillips I2 C compatible)
- Programmable watchdog timer with separate on-chip oscillator
- On-chip analog comparator
- Interrupt and wake-up on pin change
-
Special microcontroller features
- Power-on reset and programmable brown-out detection
- Internal calibrated oscillator
- External and internal interrupt sources
- Six sleep modes: Idle, ADC noise reduction, power-save, power-down, standby, and extended standby
-
I/O and packages
- 23 programmable I/O lines
- 32-lead TQFP, and 32-pad QFN/MLF
-
Operating voltage:
- 2.7V to 5.5V for ATmega328P
-
Temperature range:
- Automotive temperature range: –40°C to +125°C
-
Speed grade:
- 0 to 8MHz at 2.7 to 5.5V (automotive temperature range: –40°C to +125°C)
- 0 to 16MHz at 4.5 to 5.5V (automotive temperature range: –40°C to +125°C)
-
Low power consumption
- Active mode: 1.5mA at 3V 4MHz ● Power-down mode: 1µA at 3V
Pin Configuration
Figure 1-1. Pinout
1.1 Pin Descriptions
1.1.1 VCC
Digital supply voltage.
1.1.2 GND
Ground.
1.1.3 Port B (PB7:0) XTAL1/XTAL2/TOSC1/TOSC2
Port B is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The Port B output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, port B pins that are externally pulled low will source current if the pull-up resistors are activated. The Port B pins are tri-stated when a reset condition becomes active, even if the clock is not running.
Depending on the clock selection fuse settings, PB6 can be used as input to the inverting oscillator amplifier and input to the internal clock operating circuit.
Depending on the clock selection fuse settings, PB7 can be used as output from the inverting oscillator amplifier.
If the internal calibrated RC oscillator is used as chip clock source, PB7..6 is used as TOSC2..1 input for the asynchronous Timer/Counter2 if the AS2 bit in ASSR is set.
The various special features of port B are elaborated in Section 13.3.1 "Alternate Functions of Port B" on page 65 and Section 8. "System Clock and Clock Options" on page 24.
1.1.4 Port C (PC5:0)
Port C is a 7-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The PC5..0 output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, Port C pins that are externally pulled low will source current if the pull-up resistors are activated. The port C pins are tri-stated when a reset condition becomes active, even if the clock is not running.
1.1.5 PC6/RESET
If the RSTDISBL fuse is programmed, PC6 is used as an input pin. If the RSTDISBL fuse is unprogrammed, PC6 is used as a reset input. A low level on this pin for longer than the minimum pulse length will generate a reset, even if the clock is not running. The minimum pulse length is given in Table 28-4 on page 261. Shorter pulses are not guaranteed to generate a reset.
The various special features of port C are elaborated in Section 13.3.2 "Alternate Functions of Port C" on page 68.
1.1.6 Port D (PD7:0)
Port D is an 8-bit bi-directional I/O port with internal pull-up resistors (selected for each bit). The port D output buffers have symmetrical drive characteristics with both high sink and source capability. As inputs, port D pins that are externally pulled low will source current if the pull-up resistors are activated. The port D pins are tri-stated when a reset condition becomes active, even if the clock is not running.
The various special features of port D are elaborated in Section 13.3.3 "Alternate Functions of Port D" on page 70.
1.1.7 AVCC
AVCC is the supply voltage pin for the A/D converter, PC3:0, and ADC7:6. It should be externally connected to VCC, even if the ADC is not used. If the ADC is used, it should be connected to VCC through a low-pass filter. Note that PC6..4 use digital supply voltage, VCC.
1.1.8 AREF
AREF is the analog reference pin for the A/D converter.
1.1.9 ADC7:6 (TQFP and QFN/MLF Package Only)
In the TQFP and QFN/MLF package, ADC7:6 serve as analog inputs to the A/D converter. These pins are powered from the analog supply and serve as 10-bit ADC channels.
1.2 Disclaimer
Typical values contained in this datasheet are based on simulations and characterization of actual ATmega328P AVR® microcontrollers manufactured on the typical process technology. automotive min and max values are based on characterization of actual ATmega328P AVR microcontrollers manufactured on the whole process excursion (corner run).
1.3 Automotive Quality Grade
The ATmega328P have been developed and manufactured according to the most stringent requirements of the international standard ISO-TS-16949. This data sheet contains limit values extracted from the results of extensive characterization (temperature and voltage). The quality and reliability of the ATmega328P have been verified during regular product qualification as per AEC-Q100 grade 1. As indicated in the ordering information paragraph, the products are available in only one temperature.
Table 1-1. Temperature Grade Identification for Automotive Products
| Temperature | Temperature Identifier | Comments |
|---|---|---|
| –40°C; +125°C | Z | Full automotive temperature range |
Electrical Characteristics
All DC/AC characteristics contained in this datasheet are based on characterization of Atmel® ATmega328P AVR® microcontroller manufactured in an automotive process technology.
28.1 Absolute Maximum Ratings
Stresses beyond those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
| Parameters | Min. | Typ. | Max. | Unit |
|---|---|---|---|---|
| Operating temperature | –55 | +125 | °C | |
| Storage temperature | –65 | +150 | °C | |
| Voltage on any pin except RESET with respect to ground | –0.5 | VCC + 0.5 | V | |
| Voltage on RESET with respect to ground | –0.5 | +13.0 | V | |
| Maximum operating voltage | 6.0 | V | ||
| DC current per I/O pin | 40.0 | mA | ||
| DC current VCC and GND pins | 200.0 | mA | ||
| Injection current at VCC = 0V | ±5.0(1) | mA | ||
| Injection current at VCC = 5V | ±1.0 | mA |
Note: 1. Maximum current per port = ±30mA
Absolute Maximum Ratings
Stresses beyond those listed under "Absolute Maximum Ratings" may cause permanent damage to the device. This is a stress rating only and functional operation of the device at these or any other conditions beyond those indicated in the operational sections of this specification is not implied. Exposure to absolute maximum rating conditions for extended periods may affect device reliability.
| Parameters | Min. | Typ. | Max. | Unit |
|---|---|---|---|---|
| Operating temperature | –55 | +125 | °C | |
| Storage temperature | –65 | +150 | °C | |
| Voltage on any pin except RESET with respect to ground | –0.5 | VCC + 0.5 | V | |
| Voltage on RESET with respect to ground | –0.5 | +13.0 | V | |
| Maximum operating voltage | 6.0 | V | ||
| DC current per I/O pin | 40.0 | mA | ||
| DC current VCC and GND pins | 200.0 | mA | ||
| Injection current at VCC = 0V | ±5.0(1) | mA | ||
| Injection current at VCC = 5V | ±1.0 | mA |
Note: 1. Maximum current per port = ±30mA
Get structured datasheet data via API
Get started free