![Geehy SEMICONDUCTOR APM32F030x4x6x8xC Скачать руководство пользователя страница 275](http://html1.mh-extra.com/html/geehy-semiconductor/apm32f030x4x6x8xc/apm32f030x4x6x8xc_user-manual_573629275.webp)
www.geehy.com Page 274
Figure 105 Master Reads Data from Slave
SLAVE ADDRESS
S
R
A
DATA
A
DATA
A
P
Note:
(
1
)
: This data is transferred from master to slave
(
2
)
S: Start signal
(
3
)
SLAVE ADDRESS: Slave address
(
4
)
: This data is transferred from slave to master
(
5
)
R/W: Selection bit of transmission direction
(
6
)
1 means reading, while 0 means writing
(
7
)
P: Stop signal
After the start signal is generated, all slaves will wait for the slave address signal
transmitted 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 transmission 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 transmission 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 master sends one byte of data, it needs to wait for the acknowledge
signal of the slave. When the master wants to stop receiving data, it needs to
return a non-answer signal to the slave, then the slave will stop transmitting the
data automatically.
Introduction to I2C Clock
22.5.3.1
I2C clock source
I2C is driven by an independent clock source, and it can make I2C1 operate
independent of PCLK frequency.
I2C clock source can select HSICLK or SYSCLK.