| Electronic Components Datasheet Search |
|
STM8S Datasheet(PDF) 278 Page - STMicroelectronics |
|
|
|||||||||||||||||||||||||||||
STM8S Datasheet(HTML) 278 Page - STMicroelectronics |
|
278 / 467 page ![]() Serial peripheral interface (SPI) RM0016 278/467 DocID14587 Rev 14 To avoid any of these effects, it is recommended to respect the following procedure when disabling the SPI: In master or slave full duplex mode (BDM = 0, RXONLY = 0): 1. Wait until RXNE = 1 to receive the last data 2. Wait until TXE = 1 3. Then wait until BSY = 0 4. Disable the SPI (SPE = 0) and eventually enter Halt mode (or disable the peripheral clock). In master or slave unidirectional transmit-only mode (BDM = 0, RXONLY = 0) or bidirectional transmit mode (BDM = 1, BDOE = 1): After the last data is written in the SPI_DR register: 1. Wait until TXE = 1 2. Then wait until BSY = 0 3. Disable the SPI (SPE = 0) and, if desired, enter Halt mode (or disable the peripheral clock). In master unidirectional receive-only mode (MSTR = 1, BDM = 0, RXONLY = 1) or bidirectional receive mode (MSTR = 1, BDM = 1, BDOE = 0): This case must be managed in a particular way to ensure that the SPI does not initiate a new transfer: 1. Wait for the second to last occurrence of RXNE = 1 (n-1) 2. Then wait for one SPI clock cycle (using a software loop) before disabling the SPI (SPE = 0) 3. Then wait for the last RXNE=1 before entering Halt mode (or disabling the peripheral clock). Note: In master bidirectional receive mode (MSTR=1 and BDM=1 and BDOE=0), the BSY flag is kept low during a transfer. In slave receive-only mode (MSTR = 0, BDM = 0, RXONLY = 1) or bidirectional receive mode (MSTR = 0, BDM = 1, BDOE = 0): 1. You can disable the SPI (write SPE = 1) whenever you want: the current transfer will complete before being effectively disabled. 2. Then, if you want to enter Halt mode, you must first wait until BSY = 0 before entering Halt mode (or disabling the peripheral clock). |
|
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 |
| 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 |