atmega161-4pi ATMEL Corporation, atmega161-4pi Datasheet - Page 106

no-image

atmega161-4pi

Manufacturer Part Number
atmega161-4pi
Description
8-bit Microcontroller With 16k Bytes Of In-system Programmable Flash
Manufacturer
ATMEL Corporation
Datasheet
Port E
Port E Data Register – PORTE
Port E Data Direction Register
– DDRE
Port E Input Pins Address –
PINE
Port E as General Digital I/O
106
ATmega161(L)
Port E is a 3-bit bi-directional I/O port with internal pull-up resistors.
Three I/O address locations are allocated for the Port E, one each for the Data Register
– PORTE, $07($27), Data Direction Register – DDRE, $06($26) and the Port E Input
Pins – PINE, $05($25). The Port E Input Pins address is read-only, while the Data Reg-
ister and the Data Direction Register are read/write.
The Port E output buffers can sink 20 mA. As inputs, Port E pins that are externally
pulled low will source current if the pull-up resistors are activated.
Port E pins have alternate functions as shown in Table 35.
Table 35. Port E Pin Alternate Functions
Note:
The Port E Input Pins address (PINE) is not a register; this address enables access to
the physical value on each Port E pin. When reading PORTE, the Port E Data Latch is
read and when reading PINE, the logical values present on the pins are read.
PEn, general I/O pin: The DDEn bit in the DDRE Register selects the direction of this
pin. If DDEn is set (one), PEn is configured as an output pin. If DDEn is cleared (zero),
PEn is configured as an input pin. If PORTEn is set (one) when configured as an input
pin, the MOS pull-up resistor is activated. To switch the pull-up resistor off, the PORTEn
has to be cleared (zero) or the pin has to be configured as an output pin. The Port E pins
are tri-stated when a reset condition becomes active, even if the clock is not running.
Bit
$07 ($27)
Read/Write
Initial Value
Bit
$06 ($26)
Read/Write
Initial Value
Bit
$05 ($25)
Read/Write
Initial Value
Port Pin
PE0
PE1
PE2
1. When the PE1 pin is used for the alternate function, the DDRE and PORTE Registers
have to be set according to the alternate function description.
7
R
0
7
R
0
Alternate Function
ICP (Input Capture Pin Timer/Counter1)/INT2 (External Interrupt 2 Input)
OC1B (Timer/Counter1 Output CompareB Match Output)
ALE (Address Latch Enable, External Memory)
R
7
0
6
R
0
6
R
0
R
6
0
5
R
0
5
R
0
R
5
0
4
R
0
4
R
0
R
4
0
(1)
3
R
0
3
R
0
R
3
0
2
PINE2
R
N/A
PORTE2
2
DDE2
R/W
0
R/W
2
0
N/A
PORTE1
1
DDE1
R/W
0
1
PINE1
R
R/W
1
0
N/A
PORTE0
0
DDE0
R/W
0
0
PINE0
R
R/W
1228D–AVR–02/07
0
0
DDRE
PINE
PORTE

Related parts for atmega161-4pi