NuMicro® NUC029LEE/NUC029SEE
32-bit Arm
®
Cortex
®
-M0 Microcontroller
Aug, 2018
Page
399
of
497
Rev 1.00
N
U
MICRO
®
N
UC02
9L
E
E
/N
UC029
S
E
E
T
E
CHN
ICA
L R
E
F
E
R
E
NC
E
M
A
NU
A
L
If I
2
C is still receiving data in GC mode but got a STOP or Repeat START, the status code will be
0xA0. User could follow the action for status code 0x98 in above figure when getting 0xA0 status.
Note:
After slave gets status of 0x98 and 0xA0, slave can switch to not address mode and own
SLA will not be recognized. If entering this status, slave will not receive any I
2
C signal or address
from master. At this time, I
2
C controller should be reset to leave this status.
6.14.5.2.4
Multi-Master
In some applications, there are two or more masters on the same I
2
C bus to access slaves, and
the masters may transmit data simultaneously. The I
2
C supports multi-master by including
collision detection and arbitration to prevent data corruption.
If for some reason two masters initiate command at the same time, the arbitration procedure
determines which master wins and can continue with the command. Arbitration is performed on
the I2Cn_SDA signal while the I2Cn_SCL signal is high. Each master checks if the I2Cn_SDA
signal on the bus corresponds to the generated I2Cn_SDA signal. If the I2Cn_SDA signal on the
bus is low but it should be high, then this master has lost arbitration. The device that has lost
arbitration can generate I2Cn_SCL pulses until the byte ends. The arbitration procedure can
continue until all the data is transferred. This means that in multi-master system each master
must monitor the bus for collisions and act accordingly.
I2C_SDA
(Master1)
I2Cn_SDA
I2Cn_SCL
S
master 1 loses arbitration
DATA != I2Cn_SDA
Arbitration procedure of two masters
I2C_SDA
(Master2)
Figure 6.14-14 Arbitration Lost
When I2CSTATUS = 0x38, an “Arbitration Lost” is received. Arbitration lost event maybe
occur during the send START bit, data bits or STOP bit. User could set (STA, STO, SI,
AA) = (1, 0, 1, X) to send START again when bus free, or set (STA, STO, SI, AA) = (0, 0,
1, X) back to not addressed Slave mode.
When I2CSTATUS = 0x00, a “Bus Error” is received. To recover I
2
C bus from a bus
error, STO(I2CON[4]) should be set and SI(I2CON[3]) should be cleared, and then
STO(I2CON[4]) is cleared to release bus.
-
Set (STA, STO, SI, AA) = (0, 1, 1, X) to stop current transfer
-
Set (STA, STO, SI, AA) = (0, 0, 1, X) to release bus