The Port D pins with alternate functions
         are shown in the table below:
Table 1. Port D Pins Alternate Functions| Port Pin | Alternate Function | 
|---|
| PD7 | AIN1 (Analog Comparator Negative Input)
PCINT23 (Pin Change Interrupt 23)
 | 
| PD6 | AIN0 (Analog Comparator Positive Input)
OC0A (Timer/Counter0 Output Compare Match A Output)
 PCINT22 (Pin Change Interrupt 22)
 | 
| PD5 | T1 (Timer/Counter 1 External Counter Input)
OC0B (Timer/Counter0 Output Compare Match B Output)
 PCINT21 (Pin Change Interrupt 21)
 | 
| PD4 | XCK (USART External Clock Input/Output)
T0 (Timer/Counter 0 External Counter Input)
 PCINT20 (Pin Change Interrupt 20)
 | 
| PD3 | INT1 (External Interrupt 1 Input)
OC2B (Timer/Counter2 Output Compare Match B Output)
 PCINT19 (Pin Change Interrupt 19)
 | 
| PD2 | INT0 (External Interrupt 0 Input)
PCINT18 (Pin Change Interrupt 18)
 | 
| PD1 | TXD (USART Output Pin)
PCINT17 (Pin Change Interrupt 17)
 | 
| PD0 | RXD (USART Input Pin)
PCINT16 (Pin Change Interrupt 16)
 | 
The alternate pin configuration is as follows:
- AIN1/OC2B/PCINT23 – Port D, Bit 7- AIN1: Analog Comparator1 Negative Input. Configure the port pin as input with the
                  internal pull-up switched off to avoid the digital port function from interfering
                  with the function of the Analog Comparator.
- PCINT23: Pin Change Interrupt source 23. The PD7 pin can serve as an external
                  interrupt source.
 
- AIN0/OC0A/PCINT22 – Port D, Bit 6- AIN0: Analog Comparator0 Positive Input. Configure the port pin as input with the
                  internal pull-up switched off to avoid the digital port function from interfering
                  with the function of the Analog Comparator.
- OC0A: Output Compare Match output. The PD6 pin can serve as an external output
                  for the Timer/Counter0 Compare Match A. The PD6 pin has to be configured as an
                  output (DDD6 set (one)) to serve this function. The OC0A pin is also the output
                  pin for the PWM mode timer function.
- PCINT22: Pin Change Interrupt source 22. The PD6 pin can serve as an external
                  interrupt source.
 
- T1/OC0B/PCINT21 – Port D, Bit 5- T1: Timer/Counter1 counter source.
- OC0B: Output Compare Match output. The PD5 pin can serve as an external output
                  for the Timer/Counter0 Compare Match B. The PD5 pin has to be configured as an
                  output (DDD5 set (one)) to serve this function. The OC0B pin is also the output
                  pin for the PWM mode timer function.
- PCINT21: Pin Change Interrupt source 21. The PD5 pin can serve as an external
                  interrupt source.
 
- XCK/T0/PCINT20 – Port D, Bit 4
- INT1/OC2B/PCINT19 – Port D, Bit 3- INT1: External Interrupt source 1. The PD3 pin can serve as an external interrupt
                  source.
- OC2B: Output Compare Match output: The PD3 pin can serve as an external output
                  for the Timer/Counter2 Compare Match B. The PD3 pin has to be configured as an
                  output (DDD3 set (one)) to serve this function. The OC2B pin is also the output
                  pin for the PWM mode timer function.
- PCINT19: Pin Change Interrupt source 19. The PD3 pin can serve as an external
                  interrupt source.
 
- INT0/PCINT18 – Port D, Bit 2- INT0: External Interrupt source 0. The PD2 pin can serve as an external interrupt
                  source.
- PCINT18: Pin Change Interrupt source 18. The PD2 pin can serve as an external
                  interrupt source.
 
- TXD/PCINT17 – Port D, Bit 1- TXD: Transmit Data (Data output
                  pin for the USART). When the USART Transmitter is enabled, this pin is configured
                  as an output regardless of the value of DDD1.
- PCINT17: Pin Change Interrupt
                  source 17. The PD1 pin can serve as an external interrupt source.
 
- RXD/PCINT16 – Port D, Bit 0- RXD: Receive Data (Data input pin
                  for the USART). When the USART Receiver is enabled this pin is configured as an
                  input regardless of the value of DDD0. When the USART forces this pin to be an
                  input, the pull-up can still be controlled by the PORTD0 bit.
- PCINT16: Pin Change Interrupt
                  source 16. The PD0 pin can serve as an external interrupt source.
 
The tables below relate the alternate
         functions of Port D to the overriding signals shown in Figure 1.
Table 2. Overriding Signals for Alternate Functions PD7...PD4| Signal
Name | PD7/AIN1
/PCINT23 | PD6/AIN0/
OC0A/PCINT22 | PD5/T1/OC0B/
PCINT21 | PD4/XCK/
T0/PCINT20 | 
|---|
| PUOE | 0 | 0 | 0 | 0 | 
| PUO | 0 | 0 | 0 | 0 | 
| DDOE | 0 | 0 | 0 | 0 | 
| DDOV | 0 | 0 | 0 | 0 | 
| PVOE | 0 | OC0A ENABLE | OC0B ENABLE | UMSEL | 
| PVOV | 0 | OC0A | OC0B | XCK
                     OUTPUT | 
| DIEOE | PCINT23 • PCIE2 | PCINT22 • PCIE2 | PCINT21 • PCIE2 | PCINT20 • PCIE2 | 
| DIEOV | 1 | 1 | 1 | 1 | 
| DI | PCINT23 INPUT | PCINT22 INPUT | PCINT21 INPUT
                     / T1 INPUT | PCINT20 INPUT
                     / XCK INPUT
 / T0 INPUT | 
| AIO | AIN1 INPUT | AIN0 INPUT | – | – | 
Table 3. Overriding Signals for Alternate Functions in PD3...PD0| Signal
Name | PD3/OC2B/INT1/
PCINT19 | PD2/INT0/
PCINT18 | PD1/TXD/
PCINT17 | PD0/RXD/
PCINT16 | 
|---|
| PUOE | 0 | 0 | TXEN | RXEN | 
| PUO | 0 | 0 | 0 | PORTD0 •
                        PUD | 
| DDOE | 0 | 0 | TXEN | RXEN | 
| DDOV | 0 | 0 | 1 | 0 | 
| PVOE | OC2B ENABLE | 0 | TXEN | 0 | 
| PVOV | OC2B | 0 | TXD | 0 | 
| DIEOE | INT1 ENABLE + PCINT19 • PCIE2 | INT0 ENABLE + PCINT18 • PCIE1 | PCINT17 • PCIE2 | PCINT16 • PCIE2 | 
| DIEOV | 1 | 1 | 1 | 1 | 
| DI | PCINT19 INPUT
                     / INT1 INPUT | PCINT18 INPUT
                     / INT0 INPUT | PCINT17 INPUT | PCINT16 INPUT
                     / RXD | 
| AIO | – | – | – | – |