Professional Documents
Culture Documents
IC Interfacing
LECTURE# 25
MICROPROCESSOR SYSTEMS AND INTERFACING
Device 4
Each device has its unique 7-bit address
Device 1
Device 2
Device 3
◦ Some addresses are reserved
◦ Up to 120 devices can share an I2C bus Device Device
Master controls the clock SDA
◦ Starts and ends a transaction SCL
When a new transaction is started with end of one, by the same master
◦ A combined STOP-START condition (called RESTART) is used.
When a slave receives its address, it acknowledges during the 9th bit of
the packet
◦ ACK – Acknowledge – if 9th bit is low (slave drives the line low)
◦ NACK – Not Acknowledge – if 9th bit is high (slave did not drive the line low)
SCL from
Master
SCL from
Slave
SCL Line
Clock line is stretched
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
1 2 3 4 5 6 7 8 9 1 2 3 4 5 6 7 8 9
Stop
ACK
ACK
ACK
ACK
ACK
Address address byte #1 byte #2 byte #3
Master S 1111000 0 00001111 00000001 00000010 00000011 P
Slave A A A A A
First location address is the address of the register inside the slave
device
First
NACK
Write
Read
Start
Start
Stop
ACK
ACK
ACK
ACK
ACK
Address address Address byte #1 byte #2 byte #3
Master S 1111000 0 00001111 S 1111000 1 A A N P
Slave A A A abcdefgh ijklmnop qrstuvwx