Analog comparator
Review each signal assignment and the peripheral enable conditions in the data sheet. AIN0 → PB2 · AIN1 → PB3
Package pin assignments for ATmega1284, ATmega1284P, ATmega644, ATmega32, with peripheral signals, clock grades and a serial programming guide.
128 KiB flash · 16 KiB SRAM · 4 KiB EEPROM. Choose the marked order code for voltage, clock, and temperature.
General-purpose digital I/O. Alternate assignments: RXD (USART1), PCINT26 (EXINT), INT0 (EXINT).
After reset · GPIO driver is high impedance during reset. Clock, debug, and alternate-function use depend on fuse and peripheral configuration.
| Pin | Signal | Direction | Function |
|---|---|---|---|
| 1 | PB5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ICP (TC3), PCINT13 (EXINT), MOSI (SPI). |
| 2 | PB6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC3), PCINT14 (EXINT), MISO (SPI). |
| 3 | PB7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC3), PCINT15 (EXINT), SCK (SPI). |
| 4 | RESET Input | Input | Active-low reset input. The in-system programmer uses this pin to enter serial programming mode. |
| 5 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| 6 | GND Return | Return | Supply return. Connect every ground pin. |
| 7 | XTAL2 Output | Output | Oscillator amplifier output. Follow the selected clock mode before attaching a circuit. |
| 8 | XTAL1 Input | Input | Oscillator amplifier input or external clock input, depending on clock fuses. |
| 9 | PD0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: RXD (USART0), T (TC3), PCINT24 (EXINT). |
| 10 | PD1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TXD (USART0), PCINT25 (EXINT). |
| 11 | PD2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: RXD (USART1), PCINT26 (EXINT), INT0 (EXINT). |
| 12 | PD3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: TXD (USART1), PCINT27 (EXINT), INT1 (EXINT). |
| 13 | PD4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: XCK (USART1), OCB (TC1), PCINT28 (EXINT). |
| 14 | PD5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC1), PCINT29 (EXINT). |
| 15 | PD6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: ICP (TC1), OCB (TC2), PCINT30 (EXINT). |
| 16 | PD7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCA (TC2), PCINT31 (EXINT). |
| 17 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| 18 | GND Return | Return | Supply return. Connect every ground pin. |
| 19 | PC0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT16 (EXINT), SCL (TWI). |
| 20 | PC1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT17 (EXINT), SDA (TWI). |
| 21 | PC2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT18 (EXINT), TCK (JTAG). |
| 22 | PC3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT19 (EXINT), TMS (JTAG). |
| 23 | PC4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT20 (EXINT), TDO (JTAG). |
| 24 | PC5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT21 (EXINT), TDI (JTAG). |
| 25 | PC6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT22 (EXINT). |
| 26 | PC7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT23 (EXINT). |
| 27 | 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. |
| 28 | GND Return | Return | Supply return. Connect every ground pin. |
| 29 | AREF Analog reference | Analog reference | ADC voltage reference terminal. Check the reference selection before driving this pin from an external voltage. |
| 30 | PA7 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT7 (EXINT), ADC7 (ADC). |
| 31 | PA6 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT6 (EXINT), ADC6 (ADC). |
| 32 | PA5 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT5 (EXINT), ADC5 (ADC). |
| 33 | PA4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT4 (EXINT), ADC4 (ADC). |
| 34 | PA3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT3 (EXINT), ADC3 (ADC). |
| 35 | PA2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT2 (EXINT), ADC2 (ADC). |
| 36 | PA1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT1 (EXINT), ADC1 (ADC). |
| 37 | PA0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: PCINT0 (EXINT), ADC0 (ADC). |
| 38 | VCC Supply | Supply | Digital supply. Connect every VCC pin and place a local 100 nF ceramic bypass close to each VCC-to-ground pair. |
| 39 | GND Return | Return | Supply return. Connect every ground pin. |
| 40 | PB0 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: XCK (USART0), T (TC0), PCINT8 (EXINT). |
| 41 | PB1 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: T (TC1), PCINT9 (EXINT), CLKO0 (CPU). |
| 42 | PB2 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: AIN0 (AC), PCINT10 (EXINT), INT2 (EXINT). |
| 43 | PB3 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: AIN1 (AC), OCA (TC0), PCINT11 (EXINT). |
| 44 | PB4 Bidirectional | Bidirectional | General-purpose digital I/O. Alternate assignments: OCB (TC0), PCINT12 (EXINT), SS (SPI). |
Review each signal assignment and the peripheral enable conditions in the data sheet. AIN0 → PB2 · AIN1 → PB3
Use TXD and RXD for asynchronous serial. XCK is for synchronous mode. The signal levels follow the microcontroller supply domain. TXD → PD1 · RXD → PD0 · XCK → PB0
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 → PD4
Review each signal assignment and the peripheral enable conditions in the data sheet. T → PB0 · OCB → PB4 · OCA → PB3
Review each signal assignment and the peripheral enable conditions in the data sheet. T → PB1 · ICP → PD6 · OCA → PD5 · OCB → PD4
Review each signal assignment and the peripheral enable conditions in the data sheet. T → PD0 · ICP → PB5 · OCB → PB7 · OCA → PB6
Review each signal assignment and the peripheral enable conditions in the data sheet. OCA → PD7 · OCB → PD6
Review each signal assignment and the peripheral enable conditions in the data sheet. PCINT0 → PA0 · PCINT1 → PA1 · PCINT2 → PA2 · PCINT3 → PA3 · PCINT4 → PA4 · PCINT5 → PA5 · PCINT6 → PA6 · PCINT7 → PA7 · PCINT8 → PB0 · PCINT9 → PB1 · PCINT10 → PB2 · INT2 → PB2 · PCINT11 → PB3 · PCINT12 → PB4 · PCINT13 → PB5 · PCINT14 → PB6 · PCINT15 → PB7 · PCINT16 → PC0 · PCINT17 → PC1 · PCINT18 → PC2 · PCINT19 → PC3 · PCINT20 → PC4 · PCINT21 → PC5 · PCINT22 → PC6 · PCINT23 → PC7 · PCINT24 → PD0 · PCINT25 → PD1 · PCINT26 → PD2 · INT0 → PD2 · PCINT27 → PD3 · INT1 → PD3 · PCINT28 → PD4 · PCINT29 → PD5 · PCINT30 → PD6 · PCINT31 → PD7
Select the analog channel and reference in firmware. The reference choice and supply constrain the input range. ADC0 → PA0 · ADC1 → PA1 · ADC2 → PA2 · ADC3 → PA3 · ADC4 → PA4 · ADC5 → PA5 · ADC6 → PA6 · ADC7 → PA7
Check the JTAG fuse and enable state before using the pins for GPIO. JTAG uses TCK, TMS, TDI and TDO. TCK → PC2 · TMS → PC3 · TDO → PC4 · TDI → PC5
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 → PC1 · SCL → PC0
Use SCK, MOSI, MISO and a chip-select line. Firmware selects direction and clock phase. Check the separate ISP mapping when programming. SS → PB4 · MOSI → PB5 · MISO → PB6 · SCK → PB7
Review each signal assignment and the peripheral enable conditions in the data sheet. CLKO0 → PB1
| Parameter | Limit | Conditions and source |
|---|---|---|
| Program flash128 KiB | 128 KiB | Nonvolatile program memory. DS40002070B · Memory |
| SRAM16 KiB | 16 KiB | Volatile data and stack storage. DS40002070B · Memory |
| EEPROM4 KiB | 4 KiB | Nonvolatile data storage. DS40002070B · Memory |
| Clock and supplyOrder-code dependent | Order-code dependent | Use the grade table and the device’s speed-versus-voltage curve. DS40002070B · 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.