Electronic Components Datasheet Search
  British  ▼
ALLDATASHEET.CO.UK

X  

STM8S Datasheet(PDF) 293 Page - STMicroelectronics

Part # STM8S
Description  STM8S Series and STM8AF Series 8-bit microcontrollers
PDF  467 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
Manufacturer  STMICROELECTRONICS [STMicroelectronics]
Direct Link  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

STM8S Datasheet(HTML) 293 Page - STMicroelectronics

Back Button STM8S Datasheet HTML 289Page - STMicroelectronics STM8S Datasheet HTML 290Page - STMicroelectronics STM8S Datasheet HTML 291Page - STMicroelectronics STM8S Datasheet HTML 292Page - STMicroelectronics STM8S Datasheet HTML 293Page - STMicroelectronics STM8S Datasheet HTML 294Page - STMicroelectronics STM8S Datasheet HTML 295Page - STMicroelectronics STM8S Datasheet HTML 296Page - STMicroelectronics STM8S Datasheet HTML 297Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 293 / 467 page
background image
DocID14587 Rev 14
293/467
RM0016
Inter-integrated circuit (I2C) interface
319
Figure 103. 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 software sequence must be performed before the end of the current byte transfer.
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 311.
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 (see
Figure 104).
21.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
The peripheral input clock frequency must be at least:
1 MHz in Standard mode
4 MHz in Fast mode
7-bit slave receiver
10-bit slav e receiver
A
Data2
A
.....
DataN
A
P
AA
.....
DataN
MS37719V1
S
Address
Data1
A
EV1
EV2
EV2
EV2
EV4
EV2
EV4
A
P
EV2
Data1
Address
A
S
Header



Html Pages

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100  ...More


Datasheet Download

Go To PDF Page


Link URL



Does ALLDATASHEET help your business so far?  [ DONATE ] 

About Alldatasheet   |   Advertisement   |   Contact us   |   Privacy Policy   |   Link to Datasheet    |   Link Exchange   |   Manufacturer List
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
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