ATTINY20-XUR Atmel, ATTINY20-XUR Datasheet - Page 150

no-image

ATTINY20-XUR

Manufacturer Part Number
ATTINY20-XUR
Description
MCU AVR 2KB FLASH 12MHZ 14TSSOP
Manufacturer
Atmel
Series
AVR® ATtinyr
Datasheet

Specifications of ATTINY20-XUR

Core Processor
AVR
Core Size
8-Bit
Speed
12MHz
Connectivity
I²C, SPI
Peripherals
Brown-out Detect/Reset, POR, PWM, WDT
Number Of I /o
12
Program Memory Size
2KB (1K x 16)
Program Memory Type
FLASH
Ram Size
128 x 8
Voltage - Supply (vcc/vdd)
1.8 V ~ 5.5 V
Data Converters
A/D 8x10b
Oscillator Type
Internal
Operating Temperature
-40°C ~ 85°C
Package / Case
*
Lead Free Status / RoHS Status
Lead free / RoHS Compliant
Eeprom Size
-
Lead Free Status / Rohs Status
 Details
17.5.4
17.5.5
150
ATtiny20
TWSA – TWI Slave Address Register
TWSD – TWI Slave Data Register
• Bit 2 – TWBE: TWI Bus Error
This bit is set when an illegal bus condition has occured during a transfer. An illegal bus condi-
tion occurs if a Repeated START or STOP condition is detected, and the number of bits from the
previous START condition is not a multiple of nine.
This bit is cleared by writing a one to it.
For bus errors to be detected, the system clock frequency must be at least four times the SCL
frequency.
• Bit 1 – TWDIR: TWI Read/Write Direction
This bit indicates the direction bit from the last address packet received from a master. When
this bit is one, a master read operation is in progress. When the bit is zero a master write opera-
tion is in progress.
• Bit 0 – TWAS: TWI Address or Stop
This bit indicates why the TWASIF bit was last set. If zero, a stop condition caused TWASIF to
be set. If one, address detection caused TWASIF to be set.
The slave address register contains the TWI slave address used by the slave address match
logic to determine if a master has addressed the slave. When using 7-bit or 10-bit address rec-
ognition mode, the high seven bits of the address register (TWSA[7:1]) represent the slave
address. The least significant bit (TWSA0) is used for general call address recognition. Setting
TWSA0 enables general call address recognition logic.
When using 10-bit addressing the address match logic only support hardware address recogni-
tion of the first byte of a 10-bit address. If TWSA[7:1] is set to "0b11110nn", 'nn' will represent
bits 9 and 8 of the slave address. The next byte received is then bits 7 to 0 in the 10-bit address,
but this must be handled by software.
When the address match logic detects that a valid address byte has been received, the TWASIF
is set and the TWDIR flag is updated.
If TWPME in TWSCRA is set, the address match logic responds to all addresses transmitted on
the TWI bus. TWSA is not used in this mode.
The data register is used when transmitting and received data. During transfer, data is shifted
from/to the TWSD register and to/from the bus. Therefore, the data register cannot be accessed
during byte transfers. This is protected in hardware. The data register can only be accessed
when the SCL line is held low by the slave, i.e. when TWCH is set.
Bit
0x2A
Read/Write
Initial Value
Bit
0x28
Read/Write
Initial Value
R/W
R/W
7
0
7
0
R/W
R/W
6
0
6
0
R/W
R/W
5
0
5
0
R/W
R/W
4
0
4
0
TWSA[7:0]
TWSD[7:0]
R/W
R/W
3
0
3
0
R/W
R/W
2
0
2
0
R/W
R/W
1
0
1
0
R/W
R/W
0
0
0
0
8235B–AVR–04/11
TWSA
TWSD

Related parts for ATTINY20-XUR