AVR Internal Hardware Port D

Top  Previous  Next

Port D

 

 

Port D Pins Alternate Functions

Port

Pin

Alternate Function

PORTD.0

RDX

(UART Input line )

PORTD.1

TDX

(UART Output line)

PORTD.2

INT0

(External interrupt 0 input)

PORTD.3

INT1

(External interrupt 1 input)

PORTD.5

OC1A

(Timer/Counter1 Output compareA match output)

PORTD.6

WR

(Write strobe to external memory)

PORTD.7

RD

(Read strobe to external memory)

 

 

 

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

Output compare match output: The PD5 pin can serve as an external output when the Timer/Counter1 com-pare matches.

 

The PD5 pin has to be configured as an out-put (DDD5 set (one)) to serve this f unction. 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.

 

 

INT1 - PORTD, Bit 3

External Interrupt source 1: The PD3 pin can serve as an external interrupt source to the MCU. See the interrupt description for further details, and how to enable the source

 

 

INT0 - PORTD, Bit 2

INT0, External Interrupt source 0: The PD2 pin can serve as an external interrupt source to the MCU. See the interrupt description for further details, and how to enable the source.

 

 

TXD - PORTD, Bit 1

Transmit Data (Data output pin for the UART). When the UART transmitter is enabled, this pin is configured as an output regardless of the value of DDRD1.

 

 

RXD - PORTD, Bit 0

Receive Data (Data input pin for the UART). When the UART receiver is enabled this pin is configured as an output regardless of the value of DDRD0. When the UART forces this pin to be an input, a logical one in PORTD0 will turn on the internal pull-up.

 

 

When pins TXD and RXD are not used for RS-232 they can be used as an input or output pin.

 

No PRINT, INPUT or other RS-232 statement may be used in that case.

 

The UCR register will by default not set bits 3 and 4 that enable the TXD and RXD pins for RS-232 communication. It is however reported that this not works for all chips. In this case you must clear the bits in the UCR register with the following statements:

 

RESET UCR.3

RESET UCR.4

or as an alernative : UCR=0