No Preview Available !
8-bit AVR Microcontrollers
ATmega328/P
DATASHEET COMPLETE
Introduction
The Atmel® picoPower® ATmega328/P is a low-power CMOS 8-bit
microcontroller based on the AVR® enhanced RISC architecture. By
executing powerful instructions in a single clock cycle, the ATmega328/P
achieves throughputs close to 1MIPS per MHz. This empowers system
designer to optimize the device for power consumption versus processing
speed.
Feature
High Performance, Low Power Atmel®AVR® 8-Bit Microcontroller Family
• Advanced RISC Architecture
– 131 Powerful Instructions
– Most Single Clock Cycle Execution
– 32 x 8 General Purpose Working Registers
– Fully Static Operation
– Up to 20 MIPS Throughput at 20MHz
– On-chip 2-cycle Multiplier
• High Endurance Non-volatile Memory Segments
– 32KBytes of In-System Self-Programmable Flash program
Memory
– 1KBytes EEPROM
– 2KBytes Internal SRAM
– Write/Erase Cycles: 10,000 Flash/100,000 EEPROM
– Data Retention: 20 years at 85°C/100 years at 25°C(1)
– 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
• Atmel® QTouch® Library Support
– Capacitive Touch Buttons, Sliders and Wheels
– QTouch and QMatrix® Acquisition
– Up to 64 sense channels
Atmel-42735A-ATmega328/P_Datasheet_Complete-06/2016
18.3. Alternate Port Functions...........................................................................................................101
18.4. Register Description................................................................................................................. 113
19. TC0 - 8-bit Timer/Counter0 with PWM...................................................................125
19.1. Features................................................................................................................................... 125
19.2. Overview...................................................................................................................................125
19.3. Timer/Counter Clock Sources.................................................................................................. 127
19.4. Counter Unit............................................................................................................................. 127
19.5. Output Compare Unit................................................................................................................128
19.6. Compare Match Output Unit.....................................................................................................130
19.7. Modes of Operation..................................................................................................................131
19.8. Timer/Counter Timing Diagrams...............................................................................................135
19.9. Register Description................................................................................................................. 137
20. TC1 - 16-bit Timer/Counter1 with PWM.................................................................149
20.1. Overview...................................................................................................................................149
20.2. Features................................................................................................................................... 149
20.3. Block Diagram.......................................................................................................................... 149
20.4. Definitions.................................................................................................................................150
20.5. Registers.................................................................................................................................. 151
20.6. Accessing 16-bit Registers.......................................................................................................151
20.7. Timer/Counter Clock Sources.................................................................................................. 154
20.8. Counter Unit............................................................................................................................. 154
20.9. Input Capture Unit.................................................................................................................... 155
20.10. Output Compare Units............................................................................................................. 157
20.11. Compare Match Output Unit.....................................................................................................159
20.12. Modes of Operation..................................................................................................................160
20.13. Timer/Counter Timing Diagrams.............................................................................................. 168
20.14. Register Description.................................................................................................................169
21. Timer/Counter 0, 1 Prescalers...............................................................................186
21.1. Internal Clock Source............................................................................................................... 186
21.2. Prescaler Reset........................................................................................................................186
21.3. External Clock Source..............................................................................................................186
21.4. Register Description................................................................................................................. 187
22. TC2 - 8-bit Timer/Counter2 with PWM and Asynchronous Operation................... 189
22.1. Features................................................................................................................................... 189
22.2. Overview...................................................................................................................................189
22.3. Timer/Counter Clock Sources.................................................................................................. 191
22.4. Counter Unit............................................................................................................................. 191
22.5. Output Compare Unit................................................................................................................192
22.6. Compare Match Output Unit.....................................................................................................194
22.7. Modes of Operation..................................................................................................................195
22.8. Timer/Counter Timing Diagrams...............................................................................................199
22.9. Asynchronous Operation of Timer/Counter2............................................................................ 200
22.10. Timer/Counter Prescaler.......................................................................................................... 202
22.11. Register Description................................................................................................................. 202
Atmel ATmega328/P [DATASHEET]
Atmel-42735A-ATmega328/P_Datasheet_Complete-06/2016
5
3. Ordering Information
3.1. ATmega328
Speed [MHz](3) Power Supply [V]
20 1.8 - 5.5
Ordering Code(2)
ATmega328-AU
ATmega328-AUR(5)
ATmega328-MMH(4)
ATmega328-MMHR(4)(5)
ATmega328-MU
ATmega328-MUR(5)
ATmega328-PU
Package(1)
32A
32A
28M1
28M1
32M1-A
32M1-A
28P3
Operational Range
Industrial
(-40°C to 85°C)
Note:
1. This device can also be supplied in wafer form. Please contact your local Atmel sales office for
detailed ordering information and minimum quantities.
2. Pb-free packaging, complies to the European Directive for Restriction of Hazardous Substances
(RoHS directive). Also Halide free and fully Green.
3. Please refer to Speed Grades for Speed vs. VCC
4. Tape & Reel.
5. NiPdAu Lead Finish.
Package Type
28M1 28-pad, 4 x 4 x 1.0 body, Lead Pitch 0.45mm Quad Flat No-Lead/Micro Lead Frame Package (QFN/
MLF)
28P3 28-lead, 0.300” Wide, Plastic Dual Inline Package (PDIP)
32M1-A 32-pad, 5 x 5 x 1.0 body, Lead Pitch 0.50mm Quad Flat No-Lead/Micro Lead Frame Package (QFN/
MLF)
32A 32-lead, Thin (1.0mm) Plastic Quad Flat Package (TQFP)
Atmel ATmega328/P [DATASHEET]
Atmel-42735A-ATmega328/P_Datasheet_Complete-06/2016
11