
M0A21/M0A23 Series
May 06, 2022
Page
576
of 746
Rev 1.02
M0
A21
/M
0
A
2
3
SE
RIES
TEC
H
NICAL
RE
FEREN
C
E
M
ANUAL
Figure 6.15-12 shows a master read data from slave by 10-bit address. A master addresses a slave
with a 10-bit address. First mater transmits 10-bit address to slave, after that master transmits first byte
with read index. The slave will start transmitting data after the first byte with read index.
...
‘1’ : read
Sr
ADDRESS 1st byte
R/W
A
DATA
A
DATA
A/A
P
data transfer
(n bytes + acknowlegde)
‘0’ : write
S
ADDRESS 1st byte
R/W
A
ADDRESS 2nd byte
A
11110XX
11110XX
Figure 6.15-12 Master Reads Data from Slave by 10-bit Address
Master Mode
In Figure 6.15-13 and Figure 6.15-14, all possible protocols for I
2
C master are shown. User needs to
follow proper path of the flow to implement required I
2
C protocol.
In other words, user can send a START signal to bus and I
2
C will be in Master Transmitter mode (Figure
6.15-13) or Master receiver mode (Figure 6.15-14) after START signal has been sent successfully and
new status register would be set STARIF (UI2C_PROTSTS [8]). Followed by START signal, user can
send slave address, read/write bit, data and Repeat START, STOP to perform I
2
C protocol.
TXDAT
(SLA+W)
Master to Slave
Slave to Master
TXDAT
(Data)
P
P
STARIF = 1
(PTRG, STA, STO, AA)=(0, 1, 0, x)
Clear protocol status register
ACKIF = 1
(NACKIF = 1)
ACKIF = 1
(NACKIF = 1)
TXDAT = Data
(PTRG, STA, STO, AA)=(1, 0, 0, x)
Writing 1 to ACKIF
(Writing 1 to NACKIF)
STARIF = 1
(PTRG, STA, STO, AA)=(1, 1, 0, x)
Writing 1 to ACKIF
(Writing 1 to NACKIF)
STORIF = 1
(PTRG, STA, STO, AA)=(1, 0, 1, x)
Writing 1 to ACKIF
(Writing 1 to NACKIF)
STARIF = 1
(PTRG, STA, STO, AA)=(1, 1, 1, x)
Writing 1 to ACKIF
(Writing 1 to NACKIF)
TXDAT
(SLA+W)
ARBLOIF = 1
TXDAT = SLA+W
(PTRG, STA, STO, AA)=(1, 0, 0, x)
Write 1 to STARIF
TXDAT
(Data)
ARBLOIF = 1
TXDAT = Data
(PTRG, STA, STO, AA)=(1,0, 0, x)
Writing 1 to ACKIF
(Writing 1 to NACKIF)
Arbitration Lost
(PTRG, STA, STO, AA)=(1, 0, 0, X)
Writing 1 to ARBLOIF
...
I
2
C bus will be release;
Not addressed SLV mode will be enterd
...
(PTRG, STA, STO, AA)=(1, 1, 0, X)
Writing 1 to ARBLOIF
A START will be transmitted
when the bus becomes free
Enter not addressed SLV mode
Send a START when bus
becomes free
MT
MT
MR
TXDAT = SLA+W
(PTRG, STA, STO, AA)=(1, 0, 0, x)
Write 1 to STARIF
Sr
ACK/
NAK
ACK/
NAK
ACK/
NAK
S
ACK/
NAK
S
Writing 1 to STORIF
STORIF = 1
Writing 1 to STORIF
TXDAT
(SLA+W)
TXDAT = SLA+W
(PTRG, STA, STO, AA)=(1, 0, 0, X)
ACK
To corresponding states in
slave mode
ARBLOIF = 1
Figure 6.15-13 Master Transmitter Mode Control Flow with 7-bit Address