243
XMEGA B [DATASHEET]
8291B–AVR–01/2013
Figure 19-12.TWI master operation.
The number of interrupts generated is kept to a minimum by automatic handling of most conditions. Quick command and
smart mode can be enabled to auto-trigger operations and reduce software complexity.
19.5.1 Transmitting Address Packets
After issuing a START condition, the master starts performing a bus transaction when the master address register is
written with the 7-bit slave address and direction bit. If the bus is busy, the TWI master will wait until the bus becomes idle
before issuing the START condition.
Depending on arbitration and the R/W direction bit, one of four distinct cases (M1 to M4) arises following the address
packet. The different cases must be handled in software.
19.5.1.1 Case M1: Arbitration lost or bus error during address packet
If arbitration is lost during the sending of the address packet, the master write interrupt flag and arbitration lost flag are
both set. Serial data output to the SDA line is disabled, and the SCL line is released. The master is no longer allowed to
perform any operation on the bus until the bus state has changed back to idle.
A bus error will behave in the same way as an arbitration lost condition, but the error flag is set in addition to the write
interrupt and arbitration lost flags.
19.5.1.2 Case M2: Address packet transmit complete - Address not acknowledged by slave
If no slave device responds to the address, the master write interrupt flag and the master received acknowledge flag are
set. The clock hold is active at this point, preventing further activity on the bus.
19.5.1.3 Case M3: Address packet transmit complete - Direction bit cleared
If the master receives an ACK from the slave, the master write interrupt flag is set and the master received acknowledge
flag is cleared. The clock hold is active at this point, preventing further activity on the bus.
IDLE
S
BUSY
BUSY
P
Sr
P
M3
M3
M2
M2
M1
M1
R
DATA
ADDRESS
W
A/A
DATA
Wait for
IDLE
APPLICATION
SW
SW
Sr
P
M3
M2
BUSY
M4
A
SW
A/A
A/A
A/A
M4
A
IDLE
IDLE
MASTER READ INT HOLD
MASTER WRITE INT HOLD
SW
SW
SW
BUSY
R/W
SW
Driver software
The master provides data
on the bus
Slave provides data on
the bus
A
A
R/W
BUSY
M4
Bus state
Mn
Diagram connections
Содержание XMEGA B
Страница 320: ...320 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 12 7 segments Character Table...
Страница 321: ...321 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 13 14 segments Character Table...
Страница 322: ...322 XMEGA B DATASHEET 8291B AVR 01 2013 Table 25 14 16 segments Character Table...
Страница 412: ...412 XMEGA B DATASHEET 8291B AVR 01 2013...
Страница 413: ...413 XMEGA B DATASHEET 8291B AVR 01 2013...
Страница 414: ...414 XMEGA B DATASHEET 8291B AVR 01 2013...