Electronic Components Datasheet Search
  British  ▼
ALLDATASHEET.CO.UK

X  

STM8S Datasheet(PDF) 277 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) 277 Page - STMicroelectronics

Back Button STM8S Datasheet HTML 273Page - STMicroelectronics STM8S Datasheet HTML 274Page - STMicroelectronics STM8S Datasheet HTML 275Page - STMicroelectronics STM8S Datasheet HTML 276Page - STMicroelectronics STM8S Datasheet HTML 277Page - STMicroelectronics STM8S Datasheet HTML 278Page - STMicroelectronics STM8S Datasheet HTML 279Page - STMicroelectronics STM8S Datasheet HTML 280Page - STMicroelectronics STM8S Datasheet HTML 281Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 277 / 467 page
background image
DocID14587 Rev 14
277/467
RM0016
Serial peripheral interface (SPI)
287
20.3.7
Status flags
There are three status flags to allow the application to completely monitor the state of the
SPI bus.
Tx buffer empty flag (TXE)
When set, this flag indicates that the Tx buffer is empty and that the next data to be
transmitted can be loaded into the buffer. The TXE flag is reset when writing the SPI_DR
register.
Rx buffer not empty (RXNE)
When set, this flag indicates that there is a valid received data in the Rx buffer. This flag is
reset when SPI_DR is read.
Busy flag (BSY)
This BSY flag is set and reset by hardware (writing to this flag has no effect). The BSY flag
indicates the state of the communication layer of the SPI.
When BSY is set, it indicates that the SPI is busy communicating. There is one exception in
master mode / bidirectional receive mode (MSTR=1 and BDM=1 and BDOE=0) where the
BSY flag is kept low during the reception.
The BSY flag is useful to detect the end of a transfer if the software wants to disable the SPI
and enters Halt mode (or disable the peripheral clock). This will avoid corrupting the last
transfer. For this, the procedure described below must be strictly respected.
The BSY flag is also useful to avoid write collisions in a multimaster system.
The BSY flag is set when a transfer starts with the exception of master mode / bidirectional
receive mode (MSTR = 1 and BDM = 1 and BDOE = 0).
It is reset:
when a transfer is finished (except in master mode if the communication is continuous)
when the SPI is disabled
when a master mode fault occurs (MODF = 1)
When communication is not continuous, the BSY flag is low between each communication.
When communication is continuous, in master mode, the BSY flag is kept high during the
whole transfers.
When communication is continuous, in slave mode, the BSY flag goes back to low state for
one SPI clock cycle between each transfer.
Note:
Do not use the BSY flag to handle each data transmission or reception. It is better to use
TXE and RXNE flags instead.
20.3.8
Disabling the SPI
When a transfer is terminated, the application can stop the communication by disabling the
SPI peripheral. This is done by resetting the SPE bit.
For some configurations, disabling the SPI and entering Halt mode while a transfer is on-
going, can cause the current transfer to be corrupted and/or it can happen that the BSY flag
becomes unreliable.



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