
124
ATtiny40 [DATASHEET]
8263B–AVR–01/2013
17.3.1
Electrical Characteristics
17.3.2
START and STOP Conditions
Two unique bus conditions are used for marking the beginning (START) and end (STOP) of a transaction. The
master issues a START condition(S) by indicating a high to low transition on the SDA line while the SCL line is kept
high. The master completes the transaction by issuing a STOP condition (P), indicated by a low to high transition
on the SDA line while SCL line is kept high.
Figure 17-3. START and STOP Conditions
Multiple START conditions can be issued during a single transaction. A START condition not directly following a
STOP condition, are named a Repeated START condition (Sr).
17.3.3
Bit Transfer
As illustrated by
Figure 17-4 a bit transferred on the SDA line must be stable for the entire high period of the SCL
line. Consequently the SDA value can only be changed during the low period of the clock. This is ensured in hard-
ware by the TWI module.
Figure 17-4. Data Validity
Combining bit transfers results in the formation of address and data packets. These packets consist of 8 data bits
(one byte) with the most significant bit transferred first, plus a single bit not-acknowledge (NACK) or acknowledge
(ACK) response. The addressed device signals ACK by pulling the SCL line low, and NACK by leaving the line
SCL high during the ninth clock cycle.
17.3.4
Address Packet
After the START condition, a 7-bit address followed by a read/write (R/W) bit is sent. This is always transmitted by
the Master. A slave recognizing its address will ACK the address by pulling the data line low the next SCL cycle,
while all other slaves should keep the TWI lines released, and wait for the next START and address. The 7-bit
address, the R/W bit and the acknowledge bit combined is the address packet. Only one address packet for each
START condition is given, also when 10-bit addressing is used.