18.3.3 Alternate Functions of Port D

The Port D pins with alternate functions are shown in the table below:

Table 18-9. Port D Pins Alternate Functions
Port PinAlternate Function
PD7AIN1 (Analog Comparator Negative Input)

PD6AIN0 (Analog Comparator Positive Input)

PD5T1 (Timer/Counter 1 External Counter Input)

PD4XCK (USART External Clock Input/Output)
T0 (Timer/Counter 0 External Counter Input)

PD3INT1 (External Interrupt 1 Input)

PD2INT0 (External Interrupt 0 Input)

PD1TXD (USART Output Pin)

PD0RXD (USART Input Pin)


The alternate pin configuration is as follows:

• AIN1 – Port D, Bit 7

AIN1, Analog Comparator 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.

• AIN0 – Port D, Bit 6

AIN0, Analog Comparator 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.

• T1 – Port D, Bit 5

T1, Timer/Counter1 counter source.

• XCK/T0 – Port D, Bit 4

XCK, USART external clock.

T0, Timer/Counter0 counter source.

• INT1 – Port D, Bit 3

INT1, External Interrupt source 1: The PD3 pin can serve as an external interrupt source.

• INT0 – Port D, Bit 2

INT0, External Interrupt source 0: The PD2 pin can serve as an external interrupt source.

• TXD – 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.

• RXD – 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.

The tables below relate the alternate functions of Port D to the overriding signals shown in figure Figure 18-5.

Table 18-10. Overriding Signals for Alternate Functions PD7:PD4
Signal
NamePD7/AIN1
PD6/AIN0PD5/T1PD4/XCK/
T0
PUOE0000
PUO0000
OOE0000
OO0000
PVOE000UMSEL
PVO000XCK OUTPUT
DIEOE0000
DIEO0000
DIT1 INPUTXCK INPUT / T0 INPUT
AIOAIN1 INPUTAIN0 INPUT
Table 18-11. Overriding Signals for Alternate Functions in PD3:PD0
Signal
NamePD3/INT1PD2/INT0PD1/TXDPD0/RXD
PUOE00TXENRXEN
PUO000PORTD0 • PUD
OOE00TXENRXEN
OO0010
PVOE00TXEN0
PVO00TXD0
DIEOEINT1 ENABLEINT0 ENABLE00
DIEO1100
DI
INT1 INPUTINT0 INPUTRXD
AIO