ATTINY12 ATMEL Corporation, ATTINY12 Datasheet - Page 44

no-image

ATTINY12

Manufacturer Part Number
ATTINY12
Description
8-bit AVR Microcontroller with 1K Byte Flash
Manufacturer
ATMEL Corporation
Datasheet

Available stocks

Company
Part Number
Manufacturer
Quantity
Price
Part Number:
ATTINY12-8PC
Manufacturer:
ATM
Quantity:
27 705
Part Number:
ATTINY12-8PC
Manufacturer:
AD
Quantity:
56
Part Number:
ATTINY12-8PC
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY12-8SC
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY12-8SI
Manufacturer:
ATMEL
Quantity:
1 729
Part Number:
ATTINY12-8SU
Manufacturer:
ATMEL
Quantity:
5
Part Number:
ATTINY128SC
Manufacturer:
ATMEL
Quantity:
7 373
Company:
Part Number:
ATTINY12L-4PC
Quantity:
50
Part Number:
ATTINY12L-4SC
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Part Number:
ATTINY12L-4SU
Manufacturer:
MICROCHIP/微芯
Quantity:
20 000
Part Number:
ATTINY12V-1SI
Manufacturer:
ATMEL/爱特梅尔
Quantity:
20 000
Port B Data Register – PORTB
Port B Data Direction Register
– DDRB
Port B Input Pins Address –
PINB
Port B as General Digital I/O
44
ATtiny11/12
Note:
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 Port B Data
Latch is read, and when reading PINB, the logical values present on the pins are read.
The lowermost five pins in port B have equal functionality when used as digital I/O pins.
PBn, General I/O pin: The DDBn bit in the DDRB register selects the direction of this
pin, if DDBn is set (one), PBn is configured as an output pin. If DDBn is cleared (zero),
PBn is configured as an input pin. If PORTBn is set (one) when the pin is configured as
an input pin, the MOS pull-up resistor is activated. On ATtiny12 this feature can be dis-
abled by setting the Pull-up Disable (PUD) bit in the MCUCR register. To switch the pull-
up resistor off, the PORTBn can be cleared (zero), the pin can be configured as an out-
put pin, or in ATtiny12, the PUD bit can be set. The port pins are tri-stated when a reset
condition becomes active, even if the clock is not running.
Table 20. DDBn Effects on Port B Pins
n: 4,3…0, pin number.
Note that in ATtiny11, PB5 is input only. On ATtiny12, PB5 is input or open-drain output.
Because this pin is used for 12V programming, there is no ESD protection diode limiting
the voltage on the pin to V
the voltage on this pin does not rise above V
cause the MCU to reset or enter programming mode unintentionally.
Bit
$18
Read/Write
Initial Value
Bit
$17
Read/Write
Initial Value
Bit
$16
Read/Write
Initial Value
DDBn
0
0
1
1
DDB5 is only available in ATtiny12.
PORTBn
0
1
0
1
R
R
R
7
0
7
0
7
0
-
-
-
Output
Output
Input
Input
I/O
R
R
R
6
0
6
0
6
0
-
-
-
CC
(DDB5)
Pull-up
+ 0.5V. Thus, special care should be taken to ensure that
PINB5
R(/W)
N/A
Yes
R
R
5
0
5
0
5
No
No
No
-
PORTB4
PINB4
DDB4
R/W
R/W
Comment
Tri-state (Hi-Z)
PBn will source current if ext. pulled low. In ATtiny12
pull-ups can be disabled by setting the PUD bit.
Push-pull Zero Output
Push-pull One Output
N/A
R
4
0
4
0
4
CC
PORTB3
PINB3
DDB3
R/W
R/W
+ 1V during normal operation. This may
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
PORTB0
PINB0
DDB0
R/W
R/W
N/A
1006D–AVR–07/03
0
0
0
0
0
R
PORTB
DDRB
PINB

Related parts for ATTINY12