GD32VF103 User Manual
357
Clock synchronization is performed using the wired-AND connection of I2C interfaces to the
SCL line. This means that a HIGH to LOW transition on the SCL line causes the masters
concerned to start counting off their LOW period and, once a master clock has gone LOW, it
holds the SCL line in that state until the clock HIGH state is reached (see
). However, if another clock is still within its LOW period, the LOW to HIGH
transition of this clock may not change the state of the SCL line. The SCL line is therefore
held LOW by the master with the longest LOW period. Masters with shorter LOW periods
enter a HIGH wait-state during this time.
Figure 17-4. Clock synchronization
CLK1
CLK2
SCL
17.3.5.
Arbitration
Arbitration, like synchronization, is part of the protocol where more than one master is used
in the system. Slaves are not involved in the arbitration procedure.
A master may start a transfer only if the bus is free. Two masters may generate a START
condition within the minimum hold time of the START condition which results in a valid START
condition on the bus. Arbitration is then required to determine which master will complete its
transmission.
Arbitration proceeds bit by bit. During every bit, while SCL is HIGH, each master checks to
see whether the SDA level matches what it has sent. This process may take many bits. Two
masters can even complete an entire transaction without error, as long as the transmissions
are identical. The first time a master tries to send a HIGH, but detects that the SDA level is
LOW, then the master knows that it has lost the arbitration and turns off its SDA output driver.
The other master goes on to complete its transaction.
Figure 17-5. SDA Line arbitration
SDA
SCL
SDA from
master2
SDA from
master1
1
1
1
0
0
0
1
1
1
1
0
0
17.3.6.
I2C communication flow
Each I2C device is recognized by a unique address (whether it is a microcontroller, LCD driver,
memory or keyboard interface) and can operate as either a transmitter or receiver, depending