atmega103 ATMEL Corporation, atmega103 Datasheet - Page 95

no-image

atmega103

Manufacturer Part Number
atmega103
Description
Atmega103 8-bit With 128k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
atmega103-6AC
Manufacturer:
ATMEL
Quantity:
1
Part Number:
atmega103-6AI
Manufacturer:
ATMEL
Quantity:
586
Part Number:
atmega103-6AI
Manufacturer:
Atmel
Quantity:
10 000
Port D Data Register – PORTD
Port D Data Direction Register
– DDRD
Port D Input Pins Address –
PIND
Port D as General Digital I/O
Alternate Functions of Port D
0945I–AVR–02/07
When the pins are used for the alternate function, the DDRD and PORTD Registers
have to be set according to the alternate function description.
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 Port D Data Latch
is read, and when reading PIND, the logical values present on the pins are read.
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. The port pins are tri-
stated when a reset condition becomes active, even if the clock is not running.
Table 32. DDDn Bits on Port D Pins
Note:
The alternate pin functions of Port D are:
• INT0..INT3 – Port D, Bits 0..3
External Interrupt sources 0 - 3. The PD0 - PD3 pins can serve as external active low
interrupt sources to the MCU. The internal pull-up MOS resistors can be activated as
described above. See the interrupt description for further details, and how to enable the
sources.
Bit
$12
Read/Write
Initial Value
Bit
$11
Read/Write
Initial Value
Bit
$10
Read/Write
Initial Value
DDDn
0
0
1
1
n: 7,6...0, pin number
PORTDn
PORTD7
PIND7
DDD7
R/W
R/W
N/A
R
7
0
7
0
7
0
1
0
1
PORTD6
PIND6
DDD6
R/W
R/W
N/A
R
6
0
6
0
6
Output
Output
Input
Input
I/O
PORTD5
PIND5
DDD5
R/W
R/W
N/A
R
5
0
5
0
5
Pull-up
Yes
No
No
No
PORTD4
PIND4
DDD4
R/W
R/W
N/A
R
4
0
4
0
4
Comment
Tri-state (high-Z)
PDn will source current if ext. pulled low.
Push-pull Zero Output
Push-pull One Output
PORTD3
PIND3
DDD3
R/W
R/W
N/A
3
0
3
0
3
R
PORTD2
PIND2
DDD2
R/W
R/W
N/A
2
0
2
0
2
R
ATmega103(L)
PORTD1
PIND1
DDD1
R/W
R/W
N/A
R
1
0
1
0
1
PORTD0
PIND0
DDD0
R/W
R/W
N/A
R
0
0
0
0
0
PORTD
DDRD
PIND
95

Related parts for atmega103