ATTINY15 ATMEL [ATMEL Corporation], ATTINY15 Datasheet - Page 51

no-image

ATTINY15

Manufacturer Part Number
ATTINY15
Description
Manufacturer
ATMEL [ATMEL Corporation]
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATTINY15L
Manufacturer:
ATMEL
Quantity:
5 510
Part Number:
ATTINY15L
Manufacturer:
SIEMENS
Quantity:
5 510
Part Number:
ATTINY15L-1PC
Quantity:
1 670
Part Number:
ATTINY15L-1PI
Manufacturer:
AIMEL
Quantity:
5 510
Part Number:
ATTINY15L-1PI
Manufacturer:
VISHAY
Quantity:
5 510
Part Number:
ATTINY15L-1PI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY15L-1SC
Manufacturer:
ATMEL
Quantity:
3 447
Part Number:
ATTINY15L-1SC
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY15L-1SI
Manufacturer:
ATMEL
Quantity:
8
Part Number:
ATTINY15L-1SI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY15L-1SU
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
I/O Port B
Alternative Functions of
Port B
The Port B Data Register –
PORTB
The Port B Data Direction
Register – DDRB
The Port B Input Pins Address
– PINB
1187D–12/01
All AVR ports have true read-modify-write functionality when used as general digital I/O
ports. This means that the direction of one port pin can be changed without unintention-
ally changing the direction of any other pin with the SBI and CBI instructions. The same
applies for changing drive value (if configured as output) or enabling/disabling of pull-up
resistors (if configured as input).
Port B is a 6-bit bi-directional I/O port.
Three data memory address locations are allocated for Port B, one each for the Data
Register – PORTB, $18, Data Direction Register – DDRB, $17, and the Port B Input
Pins – PINB, $16. The Port B Input Pins address is read-only, while the Data Register
and the Data Direction Register are read/write.
Ports PB5..0 have special functions as described in the section “Pin Descriptions” on
page 4. If PB5 is not configured as external reset, it is input with no pull-up or as an
open-drain output. All I/O pins have individually selectable pull-ups, which can be over-
ridden with pull-up disable.
The Port B output buffers on PB0 to PB4 can sink 20 mA and thus drive LED displays
directly. PB5 can sink 12 mA. When pins PB0 to PB4 are used as inputs and are exter-
nally pulled low, they will source current (I
In ATtiny15L four Port B pins – PB2, PB3, PB4, and PB5 – have alternative functions as
inputs for the ADC. If some Port B pins are configured as outputs, it is essential that
these do not switch when a conversion is in progress. This might corrupt the result of the
conversion. During Power-down mode and ADC Noise Reduction mode, the Schmitt
triggers of the digital inputs are disconnected on these pins. This allows an analog input
voltage close to V
power consumption. The Port B pins with alternate functions are shown in Table 1 on
page 4.
When the pins PB4..0 are used for the alternate function, the DDRB and PORTB regis-
ters have to be set according to the alternate function description. When PB5 is used as
external reset pin, the values in the corresponding DDRB and PORTB bit are ignored.
The Port B Input Pins address (PINB) is not a register, and this address enables access
to the physical value on each Port B pin. When reading PORTB, the PORTB Data Latch
is read, and when reading PINB, the logical values present on the pins are read.
Bit
$18
Read/Write
Initial Value
Bit
$17
Read/Write
Initial Value
Bit
$16
Read/Write
Initial Value
R
R
R
7
0
7
0
7
0
CC
/2 to be present during Power-down without causing excessive
R
R
R
6
0
6
0
6
0
PINB5
DDB5
R/W
N/A
R
R
5
0
5
0
5
PORTB4
PINB4
DDB4
R/W
R/W
N/A
R
4
0
4
0
4
IL
) if the internal pull-ups are activated.
PORTB3
PINB3
R/WS
DDB3
R/W
N/A
R
3
0
3
0
3
PORTB2
PINB2
DDB2
R/W
R/W
N/A
R
2
0
2
0
2
PORTB1
PINB1
DDB1
R/W
R/W
N/A
R
1
0
1
0
1
ATtiny15L
PORTB0
PINB0
DDB0
R/W
R/W
N/A
R
0
0
0
0
0
PORTB
DDRB
PINB
51

Related parts for ATTINY15