
202
8210C–AVR–09/11
Atmel AVR XMEGA D
When using 10-bit addressing, the address match logic only supports hardware address recog-
nition of the first byte of a 10-bit address. By setting ADDR[7:1] = 0b11110nn, ”nn” represents
bits 9 and 8 of the slave address. The next byte received is bits 7 to 0 in the 10-bit address, and
this must be handled by software.
When the address match logic detects that a valid address byte is received, APIF is set and the
DIR flag is updated.
If the PMEN bit in CTRLA is set, the address match logic responds to all addresses transmitted
on the TWI bus. The ADDR register is not used in this mode.
16.10.5
DATA
–
Data register
The data (DATA) register is used when transmitting and received data. During data transfer,
data are shifted from/to the DATA register and to/from the bus. This implies that the DATA regis-
ter cannot be accessed during byte transfers, and this is prevented by hardware. The DATA
register can be accessed only when the SCL line is held low by the slave; i.e., when CLKHOLD
is set.
When a master is reading data from the slave, data to send must be written to the DATA regis-
ter. The byte transfer is started when the master starts to clock the data byte from the slave,
followed by the slave receiving the acknowledge bit from the master. DIF and CLKHOLD are set.
When a master writes data to the slave, DIF and CLKHOLD are set when one byte has been
received in the DATA register. If smart mode is enabled, reading the DATA register will trigger
the bus operation as set by the ACKACT bit.
Accessing the DATA register will clear the slave interrupt flags and CLKHOLD.
16.10.6
ADDRMASK
–
Address Mask register
• Bit 7:1
–
ADDRMASK[7:1]: Address Mask
These bits can act as a second address match register or as an address mask register, depend-
ing on the ADDREN setting.
If ADDREN is set to zero, ADDRMASK can be loaded with a 7-bit slave address mask. Each bit
in ADDRMASK can mask (disable) the corresponding address bit in the ADDR register. If the
mask bit is one, the address match between the incoming address bit and the corresponding bit
in ADDR is ignored; i.e., masked bits will always match.
If ADDREN is set to one, ADDRMASK can be loaded with a second slave address in addition to
the ADDR register. In this mode, the slave will match on two unique addresses, one in ADDR
and the other in ADDRMASK.
Bit
7
6
5
4
3
2
1
0
DATA[7:0]
DATA
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial Value
0
0
0
0
0
0
0
0
Bit
7
6
5
4
3
2
1
0
ADDRMASK[7:1]
ADDREN
ADDRMASK
Read/Write
R/W
R/W
R/W
R/W
R/W
R/W
R/W
R/W
Initial Value
0
0
0
0
0
0
0
0