99
ATmega161(L)
1228B–09/01
to be cleared (zero) or the pin has to be configured as an output pin. The Port D pins are
tri-stated when a reset condition becomes active, even if the clock is not running.
Notes:
1. n: 7,6…0, pin number
Alternate Functions of Port D
The alternate pin configuration is as follows:
• RD
–
Port D, Bit 7
RD is the external data memory read control strobe.
• WR
–
Port D, Bit 6
WR is the external data memory write control strobe.
• OC1
–
Port D, Bit 5
OC1, Output compare match output: The PD5 pin can serve as an external output when
the Timer/Counter1 compare matches. The PD5 pin has to be configured as an output
(DDD5 set [one]) to serve this function. See “Timer/Counter1” on page 49 for further
details and how to enable the output. The OC1 pin is also the output pin for the PWM
mode timer function.
• TOSC1/TOSC2
–
Port D, Bits 5 and 4
When the AS2 bit in ASSR is set (one) to enable asynchronous clocking of
Timer/Counter2, pins PD5 and PD4 are disconnected from the port. In this mode, a
crystal oscillator is connected to the pins and the pins cannot be used as I/O pins.
• INT1
–
Port D, Bit 3
INT1, External Interrupt source 1: The PD3 pin can serve as an external interrupt source
to the MCU. See “MCU Control Register – MCUCR” on page 34 for further details.
• INT0
–
Port D, Bit 2
INT0, External Interrupt source 0: The PD2 pin can serve as an external interrupt source
to the MCU. See “MCU Control Register – MCUCR” on page 34 for further details.
• TXD0
–
Port D, Bit 1
Transmit Data (Data output pin for the UART0). When the UART0 transmitter is
enabled, this pin is configured as an output regardless of the value of DDRD1.
• RXD0
–
Port D, Bit 0
Receive Data (Data input pin for the UART0). When the UART receiver is enabled, this
pin is configured as an input regardless of the value of DDRD0. When the UART0 forces
this pin to be an input, a logical “1” in PORTD0 will turn on the internal pull-up.
Table 34.
DDDn Bits on Port D Pins
DDDn
PORTDn
I/O
Pull-up
Comment
0
0
Input
No
Tri-state (high-Z)
0
1
Input
Yes
PDn will source current if ext. pulled low.
1
0
Output
No
Push-pull Zero Output
1
1
Output
No
Push-pull One Output