| поискавой системы для электроныых деталей |
|
RM0312 датащи(PDF) 176 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
RM0312 датащи(HTML) 176 Page - STMicroelectronics |
|
176 / 275 page ![]() Inter-integrated circuit (I2C) interface RM0312 176/275 DocID022352 Rev 3 Figure 68. Transfer sequence diagram for slave receiver 1. Legend: S= Start, Sr = Repeated Start, P= Stop, A= Acknowledge, NA= Non-acknowledge, EVx= Event (with interrupt if ITEVTEN=1) EV1: ADDR =1, cleared by reading SR1 register followed by reading SR3. EV2: RXNE=1, cleared by reading DR register. EV4: STOPF=1, cleared by reading SR1 register followed by writing CR2 register 2. EV1 event stretches SCL low until the end of the corresponding software sequence. 3. EV2 event stretches SCL low if the software sequence is not completed before the end of the next byte reception. 4. After checking the SR1 register content, the user should perform the complete clearing sequence for each flag found set. Thus, for the ADDR and STOPF flags, the following sequence is recommended inside the I2C interrupt routine: READ SR1 if (ADDR == 1) {READ SR1; READ SR3} if (STOPF == 1) {READ SR1; WRITE CR2} The purpose is to make sure that both ADDR and STOPF flags are cleared if both are found set. 5. See also: Note 8 on page 192. 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 ITEVTEN bit is set. STOPF is cleared by a read of the SR1 register followed by a write to the CR2 register (refer to EV4 in Figure 68: Transfer sequence diagram for slave receiver). 19.4.2 I2C master mode In Master mode, the I2C 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_FREQR 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_CR2 register to generate a Start condition 7-bit slave receiver 10-bit slav e receiver S Address A Data1 A Data2 A ..... DataN A P EV1 EV2 EV2 EV2 EV4 S Header A Address A Data1 A ..... DataN A P EV1 EV2 EV2 EV4 ai18208 |
|
ссылки URL |
| Вашему бизинису помогли Аллдатащит? [ DONATE ] |
Что такое Аллдатащит | реклама | контакт | Конфиденциальность | Ссылка на техническое описание | обмен ссыками | поиск по производителю All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |