EasyManuals Logo

STMicroelectronics STM32F429 Reference Manual

STMicroelectronics STM32F429
1731 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #836 background imageLoading...
Page #836 background image
Inter-integrated circuit (I
2
C) interface RM0090
836/1731 DocID018909 Rev 11
Figure 242. Transfer sequence diagram for slave receiver
1. The EV1 event stretches SCL low until the end of the corresponding software sequence.
2. The EV2 event stretches SCL low if the software sequence is not completed before the end of the next byte
reception.
3. After checking the SR1 register content, the user should perform the complete clearing sequence for each
flag found set.
Thus, for ADDR and STOPF flags, the following sequence is required inside the I2C interrupt routine:
READ SR1
if (ADDR == 1) {READ SR1; READ SR2}
if (STOPF == 1) {READ SR1; WRITE CR1}
The purpose is to make sure that both ADDR and STOPF flags are cleared if both are found set.
Closing slave communication
After the last data byte is transferred a Stop Condition is generated by the master. The
interface detects this condition and sets:
The STOPF bit and generates an interrupt if the ITEVFEN bit is set.
The STOPF bit is cleared by a read of the SR1 register followed by a write to the CR1
register (see
Figure 242: Transfer sequence diagram for slave receiver EV4).
27.3.3 I
2
C master mode
In Master mode, the I
2
C interface initiates a data transfer and generates the clock signal. A
serial data transfer always begins with a Start condition and ends with a Stop condition.
Master mode is selected as soon as the Start condition is generated on the bus with a
START bit.
The following is the required sequence in master mode.
Program the peripheral input clock in I2C_CR2 Register in order to generate correct
timings
Configure the clock control registers
Configure the rise time register
Program the I2C_CR1 register to enable the peripheral
Set the START bit in the I2C_CR1 register to generate a Start condition
The peripheral input clock frequency must be at least:
2 MHz in Sm mode
4 MHz in Fm mode
7-bit slave receiver
10-bit slave receiver
Legend: S= Start, S
r
= Repeated Start, P= Stop, A= Acknowledge,
EVx= Event (with interrupt if ITEVFEN=1)
EV1: ADDR=1, cleared by reading SR1 followed by reading SR2
EV2: RxNE=1 cleared by reading DR register.
EV4: STOPF=1, cleared by reading SR1 register followed by writing to the CR1 register
S Address AData1AData2A
.....
DataNA
P
EV1 EV2 EV2 EV2 EV4
S Header A Address AData1A
.....
DataNA P
EV1 EV2 EV2
EV4
ai18208

Table of Contents

Other manuals for STMicroelectronics STM32F429

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the STMicroelectronics STM32F429 and is the answer not in the manual?

STMicroelectronics STM32F429 Specifications

General IconGeneral
BrandSTMicroelectronics
ModelSTM32F429
CategoryController
LanguageEnglish

Related product manuals