![Geehy SEMICONDUCTOR APM32F405 Series Скачать руководство пользователя страница 344](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f405-series/apm32f405-series_user-manual_573630344.webp)
www.geehy.com Page 343
Figure 85 Master Reads Data from Slave
SLAVE ADDRESS
S
R
A
DATA
A
DATA
A
P
Remarks:
(
1
)
: This data is transmitted from master to slave
(
2
)
S: Start signal
(
3
)
SLAVE ADDRESS: Slave address
(
4
)
: This data is transmitted from slave to master
(
5
)
R/W: Selection bit of transmission direction
(
6
)
1 means read
(
7
)
0 means write
(
8
)
P: Stop signal
After the start signal is generated, all slaves will wait for the slave address
signal sent by the master. In I2C bus, the address of each device is unique.
When the address signal matches the device address, the slave will be
selected, and the unselected slave will ignore the future data signal.
When the master direction is writing data
After broadcasting the address and receiving the acknowledge signal, the
master will transmit data to the slave, the data length is one byte, and every
time the master transmits one byte of data, it needs to wait for the answer signal
transmitted by the slave. After all the bytes have been transmitted, the master
will transmit a stop signal (STOP) to the slave, indicating that the transmission is
completed.
When the master direction is reading data
After broadcasting the address and receiving the acknowledge signal, the slave
will transmit the data to the master. The size of the data package is 8 bits. Every
time the slave transmits one byte of data, it needs to wait for the acknowledge
signal of the master. When the master wants to stop receiving data, it needs to
return a non-acknowledge signal to the slave, then the slave will stop
transmitting the data automatically.