![Atmel AT90S8414 Manual Download Page 70](http://html1.mh-extra.com/html/atmel/at90s8414/at90s8414_manual_3003427070.webp)
4-70
AT90S8414
Preliminary
The Port D Input Pins address - PIND - is not a register, and this address enables access to the physical value on each
Port D pin. When reading PORTD, the PORTD Data Latch is read, and when reading PIND, the logical values present on
the pins are read.
PORTD AS GENERAL DIGITAL I/O
PDn, General I/O pin: The DDDn bit in the DDRD register selects the direction of this pin. If DDDn is set (one), PDn is
configured as an output pin. If DDDn is cleared (zero), PDn is configured as an input pin. If PDn is set (one) when
configured as an input pin the MOS pull up resistor is activated. To switch the pull up resistor off the PDn has to be
cleared (zero) or the pin has to be configured as an output pin.
Table 21: DDDn Bits on Port D Pins
DDDn
PORTDn
I/O
Pull up
Comment
0
0
Input
No
Tri-state (Hi-Z)
0
1
Input
Yes
PDn will source current (IIL) if ext. pulled low.
1
0
Output
No
Push-Pull Zero Output
1
1
Output
No
Push-Pull One Output
n: 7,6…0, pin number.
ALTERNATE FUNCTIONS FOR PORTD
RD - PORTD, Bit 7:
RD is the external data memory read control strobe.
WR - PORTD, Bit 6:
WR is the external data memory write control strobe.
OC1- PORTD, 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 the Timer/Counter1
description for further details, and how to enable the output. The OC1 pin is also the output pin for the PWM mode timer
function.
OC0- PORTD, Bit 4:
OC0, Output compare match output: The PD4 pin can serve as an external output when the Timer/Counter0 compare
matches. The PD4 pin has to be configured as an output (DDD4 set (one)) to serve this function. See the Timer/Counter0
description for further details, and how to enable the output.
INT1 - PORTD, Bit 3:
INT1, External Interrupt source 1: The PD3 pin can serve as an external active low interrupt source to the MCU. The
PD3 pin has to be configured as an input (DDD3 is cleared (zero)) to serve this function. The internal pull up MOS
resistor can be activated as described above. See the interrupt description for further details, and how to enable the
source.