I
2
C Interface
The I
2
C interface is used to communicate with external peripheral devices such as sensors, EEPROM
memory etc. Originally developed by Philips, it is a two line low speed serial interface for synchronous
serial data transfer. The advantage of only two lines for communication, relatively simple
communication protocol and the ability to accommodate multiple devices on the same bus has made it
an extremely popular interface type for many applications.
I
2
C Interface Operation
The I
2
C serial interface is a two line interface, a serial data line, SDA, and serial clock line, SCL. As
many devices may be connected together on the same bus, their outputs are both open drain types. For
this reason it is necessary that external pull-high resistors are connected to these outputs. Note that no
chip select line exists, as each device on the I
2
C bus is identified by a unique address which will be
transmitted and received on the I
2
C bus.
When two devices communicate with each other on the bidirectional I
2
C bus, one is known as the
master device and one as the slave device. Both master and slave can transmit and receive data,
however, it is the master device that has overall control of the bus. For these devices, which only
operates in slave mode, there are two methods of transferring data on the I
2
C bus, the slave transmit
mode and the slave receive mode.
BS83B08-3/B12-3/B16-3/B16G-3/C24-3
8-Bit Touch Key Flash MCU
Rev. 1.50
87
April 28, 2020
D e v i c e
S l a v e
D e v i c e
M a s t e r
D e v i c e
S l a v e
V D D
S D A
S C L
I
2
C Master Slave Bus Connection
I
2
C D a t a R e g i s t e r
( S I M D )
S l a v e A d d r e s s R e g i s t e r
( S I M A )
S h i f t R e g i s t e r
D i r e c t i o n C o n t r o l
M
U
X
A d d r e s s M a t c h
H A A S B i t
I
2
C I n t e r r u p t
D a t a i n L S B
D a t a O u t M S B
T r a n s m i t / R e c e i v e
C o n t r o l U n i t
8 - b i t D a t a C o m p l e t e
D e t e c t S t a r t o r S t o p
D a t a B u s
A d d r e s s
C o m p a r a t o r
E n a b l e / D i s a b l e A c k n o w l e d g e
R e a d / w r i t e S l a v e
S R W B i t
H B B B i t
H T X B i t
H C F B i t
D e b o u n c e
C i r c u i t r y
S C L P i n
S D A P i n
I
2
C Block Diagram