Iconic Machines

Datasheet

Microchip ATmega328P microcontroller

Read the PDF ↗

Type
Datasheet

← Back to the Reference Library

Microchip ATmega328P microcontroller

ATmega48A/PA/88A/PA/168A/PA/328/P megaAVR® Data Sheet Introduction The ATmega48A/PA/88A/PA/168A/PA/328/P is a low power, CMOS 8-bit microcontrollers based on the AVR® enhanced RISC architecture. By executing instructions in a single clock cycle, the devices achieve CPU throughput approaching one million instructions per second (MIPS) per megahertz, allowing the system designer to optimize power consumption versus processing speed. Features  High Performance, Low Power 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 ̶ 4/8/16/32KBytes of In-System Self-Programmable Flash program memory ̶ 256/512/512/1KBytes EEPROM ̶ 512/1K/1K/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 QTouch® library support ̶ Capacitive touch buttons, sliders and wheels ̶ QTouch and QMatrix™ acquisition ̶ Up to 64 sense channels 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  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 1 ATmega48A/PA/88A/PA/168A/PA/328/P ̶ Real Time Counter with Separate Oscillator ̶ Six PWM Channels ̶ 8-channel 10-bit ADC in TQFP and VQFN package  ̶ 6-channel 10-bit ADC in SPDIP Package  Programmable Serial USART ̶ Master/Slave SPI Serial Interface Byte-oriented 2-wire Serial Interface (Philips I2C compatible) ̶ Programmable Watchdog Timer with Separate On-chip 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 28-pin SPDIP, 32-lead TQFP, 28-pad VQFN and 32-pad VQFN Operating Voltage: 1.8 - 5.5V Temperature Range: ̶ -40°C to 85°C Speed Grade: ̶  Interrupt and Wake-up on Pin Change Internal Calibrated Oscillator ̶  ̶ ̶ ̶  On-chip Analog Comparator Power-on Reset and Programmable Brown-out Detection ̶  ̶ Special Microcontroller Features ̶  Temperature Measurement ̶ ̶  Temperature Measurement 0 - [email protected] - 5.5V, 0 - [email protected] - 5.5.V, 0 - 20MHz @ 4.5 - 5.5V Power Consumption at 1MHz, 1.8V, 25°C ̶ ̶ Active Mode: 0.2mA Power-down Mode: 0.1µA • Power-save Mode: 0.75µA (Including 32kHz RTC) Note: 1. See “Data Retention” on page 17 for details.  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 2 ATmega48A/PA/88A/PA/168A/PA/328/P Table of Contents 1 Pin Configurations .............................................................................................................. 12 1.1 2 Pin Descriptions............................................................................................... 13 Overview .................................................................................................................................... 15 2.1 Block Diagram ................................................................................................. 15 2.2 Comparison Between Processors ................................................................... 16 3 Resources ................................................................................................................................ 17 4 Data Retention ....................................................................................................................... 17 5 About Code Examples ...................................................................................................... 17 6 Capacitive Touch Sensing ............................................................................................. 17 7 AVR CPU Core ....................................................................................................................... 18 8 9 7.1 Overview.......................................................................................................... 18 7.2 ALU – Arithmetic Logic Unit............................................................................. 19 7.3 Status Register ................................................................................................ 19 7.4 General Purpose Register File ........................................................................ 20 7.5 Stack Pointer ................................................................................................... 22 7.6 Instruction Execution Timing ........................................................................... 23 7.7 Reset and Interrupt Handling........................................................................... 23 AVR Memories ....................................................................................................................... 26 8.1 Overview.......................................................................................................... 26 8.2 In-System Reprogrammable Flash Program Memory ..................................... 26 8.3 SRAM Data Memory........................................................................................ 28 8.4 EEPROM Data Memory .................................................................................. 29 8.5 I/O Memory...................................................................................................... 30 8.6 Register Description ........................................................................................ 31 System Clock and Clock Options .............................................................................. 36 9.1 Clock Systems and their Distribution ............................................................... 36 9.2 Clock Sources ................................................................................................. 37 9.3 Low Power Crystal Oscillator........................................................................... 38 9.4 Full Swing Crystal Oscillator ............................................................................ 39 9.5 Low Frequency Crystal Oscillator .................................................................... 42 9.6 Calibrated Internal RC Oscillator ..................................................................... 43 9.7 128kHz Internal Oscillator ............................................................................... 43  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 3 ATmega48A/PA/88A/PA/168A/PA/328/P 9.8 External Clock ................................................................................................. 44 9.9 Clock Output Buffer ......................................................................................... 45 9.10 Timer/Counter Oscillator.................................................................................. 45 9.11 System Clock Prescaler .................................................................................. 45 9.12 Register Description ........................................................................................ 46 10 Power Management and Sleep Modes ................................................................... 48 10.1 Sleep Modes.................................................................................................... 48 10.2 BOD Disable(1) ................................................................................................ 49 10.3 Idle Mode......................................................................................................... 49 10.4 ADC Noise Reduction Mode............................................................................ 49 10.5 Power-down Mode........................................................................................... 49 10.6 Power-save Mode............................................................................................ 50 10.7 Standby Mode ................................................................................................. 50 10.8 Extended Standby Mode ................................................................................. 51 10.9 Power Reduction Register ............................................................................... 51 10.10 Minimizing Power Consumption ...................................................................... 51 10.11 Register Description ........................................................................................ 53 11 System Control and Reset ............................................................................................. 56 11.1 Resetting the AVR ........................................................................................... 56 11.2 Reset Sources ................................................................................................. 56 11.3 Power-on Reset............................................................................................... 57 11.4 External Reset ................................................................................................. 58 11.5 Brown-out Detection ........................................................................................ 58 11.6 Watchdog System Reset ................................................................................. 59 11.7 Internal Voltage Reference .............................................................................. 59 11.8 Watchdog Timer .............................................................................................. 60 11.9 Register Description ........................................................................................ 63 12 Interrupts ................................................................................................................................... 66 12.1 Interrupt Vectors in ATmega48A and ATmega48PA ....................................... 66 12.2 Interrupt Vectors in ATmega88A and ATmega88PA ....................................... 68 12.3 Interrupt Vectors in ATmega168A and ATmega168PA ................................... 71 12.4 Interrupt Vectors in ATmega328 and ATmega328P........................................ 74 12.5 Register Description ........................................................................................ 77 13 External Interrupts .............................................................................................................. 79 13.1 Pin Change Interrupt Timing............................................................................ 79  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 4 ATmega48A/PA/88A/PA/168A/PA/328/P 13.2 Register Description ........................................................................................ 80 14 I/O-Ports ..................................................................................................................................... 84 14.1 Overview.......................................................................................................... 84 14.2 Ports as General Digital I/O ............................................................................. 85 14.3 Alternate Port Functions .................................................................................. 89 14.4 Register Description ...................................................................................... 100 15 8-bit Timer/Counter0 with PWM ................................................................................ 102 15.1 Features ........................................................................................................ 102 15.2 Overview........................................................................................................ 102 15.3 Timer/Counter Clock Sources ....................................................................... 103 15.4 Counter Unit .................................................................................................. 103 15.5 Output Compare Unit..................................................................................... 104 15.6 Compare Match Output Unit .......................................................................... 106 15.7 Modes of Operation ....................................................................................... 107 15.8 Timer/Counter Timing Diagrams ................................................................... 111 15.9 Register Description ...................................................................................... 113 16 16-bit Timer/Counter1 with PWM ............................................................................. 120 16.1 Features ........................................................................................................ 120 16.2 Overview........................................................................................................ 120 16.3 Accessing 16-bit Registers ............................................................................ 122 16.4 Timer/Counter Clock Sources ....................................................................... 125 16.5 Counter Unit .................................................................................................. 125 16.6 Input Capture Unit ......................................................................................... 126 16.7 Output Compare Units ................................................................................... 128 16.8 Compare Match Output Unit .......................................................................... 130 16.9 Modes of Operation ....................................................................................... 131 16.10 Timer/Counter Timing Diagrams ................................................................... 138 16.11 Register Description ...................................................................................... 140 17 Timer/Counter0 and Timer/Counter1 Prescalers ........................................... 147 17.1 Internal Clock Source .................................................................................... 147 17.2 Prescaler Reset ............................................................................................. 147 17.3 External Clock Source ................................................................................... 147 17.4 Register Description ...................................................................................... 149 18 8-bit Timer/Counter2 with PWM and Asynchronous Operation ........... 150 18.1 Features ........................................................................................................ 150  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 5 ATmega48A/PA/88A/PA/168A/PA/328/P 18.2 Overview........................................................................................................ 150 18.3 Timer/Counter Clock Sources ....................................................................... 151 18.4 Counter Unit .................................................................................................. 151 18.5 Output Compare Unit..................................................................................... 152 18.6 Compare Match Output Unit .......................................................................... 154 18.7 Modes of Operation ....................................................................................... 155 18.8 Timer/Counter Timing Diagrams ................................................................... 159 18.9 Asynchronous Operation of Timer/Counter2 ................................................. 160 18.10 Timer/Counter Prescaler ............................................................................... 161 18.11 Register Description ...................................................................................... 162 19 SPI – Serial Peripheral Interface ............................................................................... 169 19.1 Features ........................................................................................................ 169 19.2 Overview........................................................................................................ 169 19.3 SS Pin Functionality ...................................................................................... 174 19.4 Data Modes ................................................................................................... 174 19.5 Register Description ...................................................................................... 176 20 USART0 .................................................................................................................................... 179 20.1 Features ........................................................................................................ 179 20.2 Overview........................................................................................................ 179 20.3 Clock Generation ........................................................................................... 180 20.4 Frame Formats .............................................................................................. 183 20.5 USART Initialization....................................................................................... 184 20.6 Data Transmission – The USART Transmitter .............................................. 185 20.7 Data Reception – The USART Receiver ....................................................... 188 20.8 Asynchronous Data Reception ...................................................................... 192 20.9 Multi-processor Communication Mode .......................................................... 195 20.10 Examples of Baud Rate Setting..................................................................... 196 20.11 Register Description ...................................................................................... 200 21 USART in SPI Mode .......................................................................................................... 205 21.1 Features ........................................................................................................ 205 21.2 Overview........................................................................................................ 205 21.3 Clock Generation ........................................................................................... 205 21.4 SPI Data Modes and Timing.......................................................................... 206 21.5 Frame Formats .............................................................................................. 206 21.6 Data Transfer................................................................................................. 209  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 6 ATmega48A/PA/88A/PA/168A/PA/328/P 21.7 AVR USART MSPIM vs. AVR SPI ................................................................ 211 21.8 Register Description ...................................................................................... 212 22 2-wire Serial Interface ..................................................................................................... 215 22.1 Features ........................................................................................................ 215 22.2 2-wire Serial Interface Bus Definition ............................................................ 215 22.3 Data Transfer and Frame Format .................................................................. 216 22.4 Multi-master Bus Systems, Arbitration and Synchronization ......................... 219 22.5 Overview of the TWI Module ......................................................................... 221 22.6 Using the TWI................................................................................................ 223 22.7 Transmission Modes ..................................................................................... 225 22.8 Multi-master Systems and Arbitration............................................................ 238 22.9 Register Description ...................................................................................... 239 23 Analog Comparator .......................................................................................................... 243 23.1 Overview........................................................................................................ 243 23.2 Analog Comparator Multiplexed Input ........................................................... 243 23.3 Register Description ...................................................................................... 244 24 Analog-to-Digital Converter ........................................................................................ 246 24.1 Features ........................................................................................................ 246 24.2 Overview........................................................................................................ 246 24.3 Starting a Conversion .................................................................................... 248 24.4 Prescaling and Conversion Timing ................................................................ 249 24.5 Changing Channel or Reference Selection ................................................... 251 24.6 ADC Noise Canceler ..................................................................................... 252 24.7 ADC Conversion Result................................................................................. 256 24.8 Temperature Measurement ........................................................................... 256 24.9 Register Description ...................................................................................... 257 25 debugWIRE On-chip Debug System ...................................................................... 262 25.1 Features ........................................................................................................ 262 25.2 Overview........................................................................................................ 262 25.3 Physical Interface .......................................................................................... 262 25.4 Software Break Points ................................................................................... 263 25.5 Limitations of debugWIRE ............................................................................. 263 25.6 Register Description ...................................................................................... 263 26 Self-Programming the Flash, ATmega 48A/48PA .......................................... 264 26.1 Overview........................................................................................................ 264  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 7 ATmega48A/PA/88A/PA/168A/PA/328/P 26.2 Addressing the Flash During Self-Programming ........................................... 265 26.3 Register Description ...................................................................................... 270 27 Boot Loader Support – Read-While-Write Self-Programming ............... 272 27.1 Features ........................................................................................................ 272 27.2 Overview........................................................................................................ 272 27.3 Application and Boot Loader Flash Sections ................................................. 272 27.4 Read-While-Write and No Read-While-Write Flash Sections........................ 273 27.5 Boot Loader Lock Bits ................................................................................... 275 27.6 Entering the Boot Loader Program ................................................................ 276 27.7 Addressing the Flash During Self-Programming ........................................... 277 27.8 Self-Programming the Flash .......................................................................... 278 27.9 Register Description ...................................................................................... 287 28 Memory Programming .................................................................................................... 289 28.1 Program And Data Memory Lock Bits ........................................................... 289 28.2 Fuse Bits........................................................................................................ 290 28.3 Signature Bytes ............................................................................................. 293 28.4 Calibration Byte ............................................................................................. 293 28.5 Page Size ...................................................................................................... 294 28.6 Parallel Programming Parameters, Pin Mapping, and Commands ............... 294 28.7 Parallel Programming .................................................................................... 296 28.8 Serial Downloading........................................................................................ 303 29 Electrical Characteristics – (TA = -40°C to 85°C) ........................................... 308 29.1 Absolute Maximum Ratings* ......................................................................... 308 29.2 DC Characteristics......................................................................................... 308 29.3 Speed Grades ............................................................................................... 312 29.4 Clock Characteristics ..................................................................................... 313 29.5 System and Reset Characteristics ................................................................ 314 29.6 SPI Timing Characteristics ............................................................................ 315 29.7 Two-wire Serial Interface Characteristics ...................................................... 317 29.8 ADC Characteristics ...................................................................................... 319 29.9 Parallel Programming Characteristics ........................................................... 320 30 Electrical Characteristics (TA = -40°C to 105°C) ............................................ 322 30.1 Absolute Maximum Ratings* ......................................................................... 322 30.2 DC Characteristics......................................................................................... 322 31 Typical Characteristics – (TA = -40°C to 85°C) ................................................ 326  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 8 ATmega48A/PA/88A/PA/168A/PA/328/P 31.1 ATmega48A Typical Characteristics ............................................................. 327 31.2 ATmega48PA Typical Characteristics ........................................................... 352 31.3 ATmega88A Typical Characteristics ............................................................. 377 31.4 ATmega88PA Typical Characteristics ........................................................... 401 31.5 ATmega168A Typical Characteristics ........................................................... 427 31.6 ATmega168PA Typical Characteristics ......................................................... 451 31.7 ATmega328 Typical Characteristics .............................................................. 477 31.8 ATmega328P Typical Characteristics ........................................................... 501 32 ATmega48PA Typical Characteristics – (TA = -40°C to 105°C) ............. 526 32.1 Active Supply Current .................................................................................... 526 32.2 Idle Supply Current ........................................................................................ 529 32.3 Power-down Supply Current.......................................................................... 531 32.4 Standby Supply Current ................................................................................ 532 32.5 Pin Pull-Up..................................................................................................... 533 32.6 Pin Driver Strength ........................................................................................ 536 32.7 Pin Threshold and Hysteresis........................................................................ 538 32.8 BOD Threshold .............................................................................................. 541 32.9 Internal Oscillator Speed ............................................................................... 542 32.10 Current Consumption of Peripheral Units ...................................................... 545 32.11 Current Consumption in Reset and Reset Pulsewidth .................................. 547 33 ATmega88PA Typical Characteristics – (TA = -40°C to 105°C) ............. 549 33.1 Active Supply Current .................................................................................... 549 33.2 Idle Supply Current ........................................................................................ 552 33.3 Power-down Supply Current.......................................................................... 554 33.4 Power-save Supply Current........................................................................... 555 33.5 Pin Pull-Up..................................................................................................... 556 33.6 Pin Driver Strength ........................................................................................ 559 33.7 Pin Threshold and Hysteresis........................................................................ 561 33.8 BOD Threshold .............................................................................................. 564 33.9 Internal Oscillator Speed ............................................................................... 565 33.10 Current Consumption of Peripheral Units ...................................................... 568 33.11 Current Consumption in Reset and Reset Pulsewidth .................................. 570 34 ATmega168PA Typical Characteristics – (TA = -40°C to 105°C) .......... 572 34.1 Active Supply Current .................................................................................... 572 34.2 Idle Supply Current ........................................................................................ 575  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 9 ATmega48A/PA/88A/PA/168A/PA/328/P 34.3 Power-down Supply Current.......................................................................... 577 34.4 Power-save Supply Current........................................................................... 578 34.5 Standby Supply Current ................................................................................ 579 34.6 Pin Pull-Up..................................................................................................... 579 34.7 Pin Driver Strength ........................................................................................ 582 34.8 Pin Threshold and Hysteresis........................................................................ 584 34.9 BOD Threshold .............................................................................................. 587 34.10 Internal Oscillator Speed ............................................................................... 590 34.11 Current Consumption of Peripheral Units ...................................................... 592 34.12 Current Consumption in Reset and Reset Pulsewidth .................................. 595 35 ATmega328P Typical Characteristics – (TA = -40°C to 105°C) .............. 597 35.1 ATmega328P Active Supply Current ............................................................. 597 35.2 Idle Supply Current ........................................................................................ 600 35.3 Power-down Supply Current.......................................................................... 602 35.4 Power-save Supply Current........................................................................... 603 35.5 Standby Supply Current ................................................................................ 604 35.6 Pin Pull-Up..................................................................................................... 604 35.7 Pin Driver Strength ........................................................................................ 607 35.8 Pin Threshold and Hysteresis........................................................................ 609 35.9 BOD Threshold .............................................................................................. 612 35.10 Internal Oscillator Speed ............................................................................... 614 35.11 Current Consumption of Peripheral Units ...................................................... 617 35.12 Current Consumption in Reset and Reset Pulsewidth .................................. 619 36 Register Summary ............................................................................................................. 621 37 Instruction Set Summary .............................................................................................. 625 38 Ordering Information ....................................................................................................... 628 38.1 ATmega48A .................................................................................................. 628 38.2 ATmega48PA ................................................................................................ 629 38.3 ATmega88A................................................................................................... 630 38.4 ATmega88PA ................................................................................................ 631 38.5 ATmega168A................................................................................................. 632 38.6 ATmega168PA ............................................................................................. 633 38.7 ATmega328 .................................................................................................. 634 38.8 ATmega328P ................................................................................................ 635 39 Packaging Information ................................................................................................... 636  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 10 ATmega48A/PA/88A/PA/168A/PA/328/P 39.1 32A ................................................................................................................ 636 39.2 28M1.............................................................................................................. 638 39.3 32M1-A .......................................................................................................... 641 39.4 28P3 .............................................................................................................. 644 40 Errata ......................................................................................................................................... 645 41 Datasheet Revision History ......................................................................................... 646 41.1 Rev. B – 08/2020 ........................................................................................... 646 41.2 Rev. A – 10/2018 ........................................................................................... 646 41.3 Rev. 8271J – 11/2015 ................................................................................... 646 41.4 Rev. 8271I – 10/2014 .................................................................................... 646 41.5 Rev. 8271H – 08/2014................................................................................... 647 41.6 Rev. 8271G – 02/2013 .................................................................................. 647 41.7 Rev. 8271F – 08/2012 ................................................................................... 647 41.8 Rev. 8271E – 07/2012 ................................................................................... 647 41.9 Rev. 8271D – 05/11....................................................................................... 648 41.10 Rev. 8271C – 08/10....................................................................................... 648 41.11 Rev. 8271B – 04/10....................................................................................... 648 41.12 Rev. 8271A – 12/09....................................................................................... 649  2020 Microchip Technology Inc. Data Sheet Complete DS40002061B-page 11 ATmega48A/PA/88A/PA/168A/PA/328/P Pin Configurations Figure 1-1. Pinout ATmega48A/PA/88A/PA/168A/PA/328/P 28 6PDIP 32 31 30 29 28 27 26 25 PD2 (INT0/PCINT18) PD1 (TXD/PCINT17) PD0 (RXD/PCINT16) PC6 (RESET/PCINT14) PC5 (ADC5/SCL/PCINT13) PC4 (ADC4/SDA/PCINT12) PC3 (ADC3/PCINT11) PC2 (ADC2/PCINT10) 32 TQFP Top View 24 23 22 21 20 19 18 17 1 2 3 4 5 6 7 8 PC1 (ADC1/PCINT9) PC0 (ADC0/PCINT8) ADC7 GND AREF ADC6 AVCC PB5 (SCK/PCINT5) (PCINT21/OC0B/T1) PD5 (PCINT22/OC0A/AIN0) PD6 (PCINT23/AIN1) PD7 (PCINT0/CLKO/ICP1) PB0 (PCINT1/OC1A) PB1 (PCINT2/SS/OC1B) PB2 (PCINT3/OC2A/MOSI) PB3 (PCINT4/MISO) PB4 9 10 11 12 13 14 15 16 (PCINT14/RESET) PC6 (PCINT16/RXD) PD0 (PCINT17/TXD) PD1 (PCINT18/INT0) PD2 (PCINT19/OC2B/INT1) PD3 (PCINT20/XCK/T0) PD4 VCC GND (PCINT6/XTAL1/TOSC1) PB6 (PCINT7/XTAL2/TOSC2) PB7 (PCINT21/OC0B/T1) PD5 (PCINT22/OC0A/AIN0) PD6 (PCINT23/AIN1) PD7 (PCINT0/CLKO/ICP1) PB0  2020 Microchip Technology Inc. PD2 (INT0/PCINT18) PD1 (TXD/PCINT17) PD0 (RXD/PCINT16) PC6 (RESET/PCINT14) PC5 (ADC5/SCL/PCINT13) PC4 (ADC4/SDA/PCINT12) PC3 (ADC3/PCINT11) PC2 (ADC2/PCINT10) PC2 (ADC2/PCINT10) PC1 (ADC1/PCINT9) PC0 (ADC0/PCINT8) GND AREF AVCC PB5 (SCK/PCINT5) (PCINT19/OC2B/INT1) PD3 (PCINT20/XCK/T0) PD4 GND VCC GND VCC (PCINT6/XTAL1/TOSC1) PB6 (PCINT7/XTAL2/TOSC2) PB7 24 23 22 21 20 19 18 17 1 2 3 4 5 6 7 8 PC1 (ADC1/PCINT9) PC0 (ADC0/PCINT8) ADC7 GND AREF ADC6 AVCC PB5 (SCK/PCINT5) 9 10 11 12 13 14 15 16 8 9 10 11 12 13 14 NOTE: Bottom pad should be soldered to ground. PC5 (ADC5/SCL/PCINT13) PC4 (ADC4/SDA/PCINT12) PC3 (ADC3/PCINT11) PC2 (ADC2/PCINT10) PC1 (ADC1/PCINT9) PC0 (ADC0/PCINT8) GND AREF AVCC PB5 (SCK/PCINT5) PB4 (MISO/PCINT4) PB3 (MOSI/OC2A/PCINT3) PB2 (SS/OC1B/PCINT2) PB1 (OC1A/PCINT1) 32 31 30 29 28 27 26 25 PD2 (INT0/PC