Analog comparator
Review each signal assignment and the peripheral enable conditions in the data sheet. AIN0 → PE2 · AIN1 → PE3
Package pin assignments for ATmega2560, with peripheral signals, clock grades and a serial programming guide.
256 KiB flash · 8 KiB SRAM · 4 KiB EEPROM · 4.5–5.5 V · 16 MHz maximum · -40 to +85 °C
Analog supply. Connect it to the supply even if analog conversion is unused. Follow the data sheet’s filtering guidance for precision conversion.
| Pin | Signal | Direction | Function |
|---|---|---|---|
| A1 | GND Return | Return | Supply return. Connect every ground pin. |
| A2 | AREF Analog reference | Analog reference | ADC voltage reference terminal. Check the reference selection before driving this pin from an external voltage. |
| A3 | PF0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ADC0 (ADC). |
| A4 | PF2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ADC2 (ADC). |
| A5 | PF5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TMS (JTAG), ADC5 (ADC). |
| A6 | PK0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT16 (EXINT), ADC8 (ADC). |
| A7 | PK3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT19 (EXINT), ADC11 (ADC). |
| A8 | PK6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT22 (EXINT), ADC14 (ADC). |
| A9 | GND Return | Return | Supply return. Connect every ground pin. |
| A10 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| B1 | AVCC Supply | Supply | Analog supply. Connect it to the supply even if analog conversion is unused. Follow the data sheet’s filtering guidance for precision conversion. |
| B2 | PG5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC0). |
| B3 | PF1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ADC1 (ADC). |
| B4 | PF3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ADC3 (ADC). |
| B5 | PF6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TDO (JTAG), ADC6 (ADC). |
| B6 | PK1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT17 (EXINT), ADC9 (ADC). |
| B7 | PK4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT20 (EXINT), ADC12 (ADC). |
| B8 | PK7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT23 (EXINT), ADC15 (ADC). |
| B9 | PA0 Bidirectional | Bidirectional | General-purpose digital I/O. |
| B10 | PA2 Bidirectional | Bidirectional | General-purpose digital I/O. |
| C1 | PE2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: AIN0 (AC), XCK (USART0). |
| C2 | PE0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: RXD (USART0), PCINT8 (EXINT). |
| C3 | PE1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TXD (USART0). |
| C4 | PF4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TCK (JTAG), ADC4 (ADC). |
| C5 | PF7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TDI (JTAG), ADC7 (ADC). |
| C6 | PK2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT18 (EXINT), ADC10 (ADC). |
| C7 | PK5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT21 (EXINT), ADC13 (ADC). |
| C8 | PJ7 Bidirectional | Bidirectional | General-purpose digital I/O. |
| C9 | PA1 Bidirectional | Bidirectional | General-purpose digital I/O. |
| C10 | PA3 Bidirectional | Bidirectional | General-purpose digital I/O. |
| D1 | PE3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: AIN1 (AC), OCA (TC3). |
| D2 | PE4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC3), INT4 (EXINT). |
| D3 | PE5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCC (TC3), INT5 (EXINT). |
| D4 | PE6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: T (TC3), INT6 (EXINT). |
| D5 | PH2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: XCK (USART2). |
| D6 | PA4 Bidirectional | Bidirectional | General-purpose digital I/O. |
| D7 | PA5 Bidirectional | Bidirectional | General-purpose digital I/O. |
| D8 | PA6 Bidirectional | Bidirectional | General-purpose digital I/O. |
| D9 | PA7 Bidirectional | Bidirectional | General-purpose digital I/O. |
| D10 | PG2 Bidirectional | Bidirectional | General-purpose digital I/O. |
| E1 | PE7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ICP (TC3), INT7 (EXINT), CLKO0 (CPU). |
| E2 | PH0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: RXD (USART2). |
| E3 | PH1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TXD (USART2). |
| E4 | PH3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC4). |
| E5 | PH5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCC (TC4). |
| E6 | PJ6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT15 (EXINT). |
| E7 | PJ5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT14 (EXINT). |
| E8 | PJ4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT13 (EXINT). |
| E9 | PJ3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT12 (EXINT). |
| E10 | PJ2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: XCK (USART3), PCINT11 (EXINT). |
| F1 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| F2 | PH4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC4). |
| F3 | PH6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC2). |
| F4 | PB0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: SS (SPI), PCINT0 (EXINT). |
| F5 | PL4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC5). |
| F6 | PD1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: SDA (TWI), INT1 (EXINT). |
| F7 | PJ1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TXD (USART3), PCINT10 (EXINT). |
| F8 | PJ0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: RXD (USART3), PCINT9 (EXINT). |
| F9 | PC7 Bidirectional | Bidirectional | General-purpose digital I/O. |
| F10 | GND Return | Return | Supply return. Connect every ground pin. |
| G1 | GND Return | Return | Supply return. Connect every ground pin. |
| G2 | PB1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: SCK (SPI), PCINT1 (EXINT). |
| G3 | PB2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: MOSI (SPI), PCINT2 (EXINT). |
| G4 | PB5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC1), PCINT5 (EXINT). |
| G5 | PL2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: T (TC5). |
| G6 | PD0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: SCL (TWI), INT0 (EXINT). |
| G7 | PD5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: XCK (USART1). |
| G8 | PC5 Bidirectional | Bidirectional | General-purpose digital I/O. |
| G9 | PC6 Bidirectional | Bidirectional | General-purpose digital I/O. |
| G10 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| H1 | PB3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: MISO (SPI), PCINT3 (EXINT). |
| H2 | PB4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC2), PCINT4 (EXINT). |
| H3 | RESET Input | Input | Active-low reset input. The in-system programmer uses this pin to enter serial programming mode. |
| H4 | PL1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ICP (TC5). |
| H5 | PL3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC5). |
| H6 | PL7 Bidirectional | Bidirectional | General-purpose digital I/O. |
| H7 | PD4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ICP (TC1). |
| H8 | PC4 Bidirectional | Bidirectional | General-purpose digital I/O. |
| H9 | PC3 Bidirectional | Bidirectional | General-purpose digital I/O. |
| H10 | PC2 Bidirectional | Bidirectional | General-purpose digital I/O. |
| J1 | PH7 Bidirectional | Bidirectional | General-purpose digital I/O. |
| J2 | PG3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TOSC2 (TC2). |
| J3 | PB6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC1), PCINT6 (EXINT). |
| J4 | PL0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ICP (TC4). |
| J5 | XTAL2 Output | Output | Oscillator amplifier output. Follow the selected clock mode before attaching a circuit. |
| J6 | PL6 Bidirectional | Bidirectional | General-purpose digital I/O. |
| J7 | PD3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TXD (USART1), INT3 (EXINT). |
| J8 | PC1 Bidirectional | Bidirectional | General-purpose digital I/O. |
| J9 | PC0 Bidirectional | Bidirectional | General-purpose digital I/O. |
| J10 | PG1 Bidirectional | Bidirectional | General-purpose digital I/O. |
| K1 | PB7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC0), OCC (TC1), PCINT7 (EXINT). |
| K2 | PG4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TOSC1 (TC2). |
| K3 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| K4 | GND Return | Return | Supply return. Connect every ground pin. |
| K5 | XTAL1 Input | Input | Oscillator amplifier input or external clock input, depending on clock fuses. |
| K6 | PL5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCC (TC5). |
| K7 | PD2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: RXD (USART1), INT2 (EXINT). |
| K8 | PD6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: T (TC1). |
| K9 | PD7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: T (TC0). |
| K10 | PG0 Bidirectional | Bidirectional | General-purpose digital I/O. |
Review each signal assignment and the peripheral enable conditions in the data sheet. AIN0 → PE2 · AIN1 → PE3
Use TXD and RXD for asynchronous serial. XCK is for synchronous mode. The signal levels follow the microcontroller supply domain. TXD → PE1 · RXD → PE0 · XCK → PE2
Use TXD and RXD for asynchronous serial. XCK is for synchronous mode. The signal levels follow the microcontroller supply domain. TXD → PD3 · RXD → PD2 · XCK → PD5
Use TXD and RXD for asynchronous serial. XCK is for synchronous mode. The signal levels follow the microcontroller supply domain. TXD → PH1 · RXD → PH0 · XCK → PH2
Use TXD and RXD for asynchronous serial. XCK is for synchronous mode. The signal levels follow the microcontroller supply domain. TXD → PJ1 · RXD → PJ0 · XCK → PJ2
Connect SDA and SCL to the bus with pull-ups to a voltage supported by all devices. Verify the pull-up value for the bus capacitance and rate. SDA → PD1 · SCL → PD0
Use SCK, MOSI, MISO and a chip-select line. Firmware selects direction and clock phase. Check the separate ISP mapping when programming. SS → PB0 · MOSI → PB2 · MISO → PB3 · SCK → PB1
Review each signal assignment and the peripheral enable conditions in the data sheet. T → PD7 · OCB → PG5 · OCA → PB7
Review each signal assignment and the peripheral enable conditions in the data sheet. TOSC1 → PG4 · TOSC2 → PG3 · OCA → PB4 · OCB → PH6
Review each signal assignment and the peripheral enable conditions in the data sheet. T → PL2 · ICP → PL1 · OCA → PL3 · OCB → PL4 · OCC → PL5
Review each signal assignment and the peripheral enable conditions in the data sheet. ICP → PL0 · OCA → PH3 · OCB → PH4 · OCC → PH5
Review each signal assignment and the peripheral enable conditions in the data sheet. T → PE6 · ICP → PE7 · OCA → PE3 · OCB → PE4 · OCC → PE5
Review each signal assignment and the peripheral enable conditions in the data sheet. T → PD6 · ICP → PD4 · OCA → PB5 · OCB → PB6 · OCC → PB7
Check the JTAG fuse and enable state before using the pins for GPIO. JTAG uses TCK, TMS, TDI and TDO. TCK → PF4 · TMS → PF5 · TDO → PF6 · TDI → PF7
Review each signal assignment and the peripheral enable conditions in the data sheet. PCINT0 → PB0 · PCINT1 → PB1 · PCINT2 → PB2 · PCINT3 → PB3 · PCINT4 → PB4 · PCINT5 → PB5 · PCINT6 → PB6 · PCINT7 → PB7 · PCINT8 → PE0 · PCINT9 → PJ0 · PCINT10 → PJ1 · PCINT11 → PJ2 · PCINT12 → PJ3 · PCINT13 → PJ4 · PCINT14 → PJ5 · PCINT15 → PJ6 · PCINT16 → PK0 · PCINT17 → PK1 · PCINT18 → PK2 · PCINT19 → PK3 · PCINT20 → PK4 · PCINT21 → PK5 · PCINT22 → PK6 · PCINT23 → PK7 · INT0 → PD0 · INT1 → PD1 · INT2 → PD2 · INT3 → PD3 · INT4 → PE4 · INT5 → PE5 · INT6 → PE6 · INT7 → PE7
Review each signal assignment and the peripheral enable conditions in the data sheet. CLKO0 → PE7
Select the analog channel and reference in firmware. The reference choice and supply constrain the input range. ADC0 → PF0 · ADC1 → PF1 · ADC2 → PF2 · ADC3 → PF3 · ADC4 → PF4 · ADC5 → PF5 · ADC6 → PF6 · ADC7 → PF7 · ADC8 → PK0 · ADC9 → PK1 · ADC10 → PK2 · ADC11 → PK3 · ADC12 → PK4 · ADC13 → PK5 · ADC14 → PK6 · ADC15 → PK7
| Parameter | Limit | Conditions and source |
|---|---|---|
| Supply and clock grade4.5–5.5 V · 16 MHz maximum | 4.5–5.5 V · 16 MHz maximum | Follow the speed-grade curve for the selected voltage. The headline clock figure is the maximum at its specified supply and temperature. 2549Q · Speed grades and ordering information |
| Ambient temperature grade-40 to +85 °C | -40 to +85 °C | For this order code. Verify silicon revision and errata in the current manufacturer documentation. 2549Q · Ordering information |
| Program flash256 KiB | 256 KiB | Nonvolatile program memory. 2549Q · Memory |
| SRAM8 KiB | 8 KiB | Volatile data and stack storage. 2549Q · Memory |
| EEPROM4 KiB | 4 KiB | Nonvolatile data storage. 2549Q · Memory |
| Clock and supplyOrder-code dependent | Order-code dependent | Use the grade table and the device’s speed-versus-voltage curve. 2549Q · Electrical Characteristics |
Each package lists the documented order codes and variants covered by this map. Select the marked model to see its peripheral assignments and memory. Check the exact order code and datasheet revision before laying out a PCB.