データシートサーチシステム
  Japanese  ▼
ALLDATASHEET.JP

X  

RM0312 データシート(PDF) 206 Page - STMicroelectronics

部品番号 RM0312
部品情報  STM8TL5xxx microcontroller family
PDF  275 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
メーカー  STMICROELECTRONICS [STMicroelectronics]
ホームページ  http://www.st.com
Logo STMICROELECTRONICS - STMicroelectronics

RM0312 データシート(HTML) 206 Page - STMicroelectronics

Back Button RM0312 Datasheet HTML 202Page - STMicroelectronics RM0312 Datasheet HTML 203Page - STMicroelectronics RM0312 Datasheet HTML 204Page - STMicroelectronics RM0312 Datasheet HTML 205Page - STMicroelectronics RM0312 Datasheet HTML 206Page - STMicroelectronics RM0312 Datasheet HTML 207Page - STMicroelectronics RM0312 Datasheet HTML 208Page - STMicroelectronics RM0312 Datasheet HTML 209Page - STMicroelectronics RM0312 Datasheet HTML 210Page - STMicroelectronics Next Button
Zoom Inzoom in Zoom Outzoom out
 206 / 275 page
background image
Serial peripheral interface (SPI)
RM0312
206/275
DocID022352 Rev 3
20.3.2
Configuring the SPI in slave mode
In slave configuration, the serial clock is received on the SCK pin from the master device.
The value set in the BR[2:0] bits in the SPI_CR1 register, does not affect the data transfer
rate.
Follow the procedure below to configure the SPI in slave mode:
1.
Select the CPOL and CPHA bits to define one of the four relationships between the
data transfer and the serial clock (see Figure 74). For correct data transfer, the CPOL
and CPHA bits must be configured in the same way in the slave device and the master
device.
2.
The frame format (MSB-first or LSB-first depending on the value of the LSBFIRST bit in
the SPI_CR1 register) must be the same as the master device.
3.
In Hardware mode (refer to Slave select (NSS) pin management on page 203), the
NSS pin must be connected to a low level signal during the complete data transmit
sequence. In NSS Software mode, set the SSM bit and clear the SSI bit in the
SPI_CR2 register.
4.
Clear the MSTR bit and set the SPE bit to assign the pins to alternate functions.
In this configuration the MOSI pin is a data input and the MISO pin is a data output.
Note:
In applications with a parallel multi-slave structure, with separate NSS signals and the slave
MISO outputs connected together, the corresponding GPIO registers must be configured
correctly. The SPI_MISO pin is controlled by the SPI peripheral only when the NSS signal is
active and the device is selected as slave. When the NSS signal is released, the pin is
driven by GPIO register settings only. To function correctly, the GPIO has to be configured in
input pull-up mode with no interrupt. This configuration is done using the GPIO_DDR,
GPIO_CR1 and GPIO_CR2 registers - see Section 10.8.1: Alternate function output.
20.3.3
Configuring the SPI master mode
In a master configuration, the serial clock is generated on the SCK pin.
Follow the procedure below to configure the SPI in master mode:
1.
Select the BR[2:0] bits to define the serial clock baud rate (see SPI_CR1 register).
2.
Select the CPOL and CPHA bits to define one of the four relationships between the
data transfer and the serial clock (see Figure 74).
3.
Configure the LSBFIRST bit in the SPI_CR1 register to define the frame format.
4.
In Hardware mode, connect the NSS pin to a high-level signal during the complete data
transmit sequence. In software mode, set the SSM and SSI bits in the SPI_CR2
register.
5.
Set the MSTR and SPE bits (they remain set only if the NSS pin is connected to a high-
level signal).
In this configuration the MOSI pin is a data output and to the MISO pin is a data input.



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


データシート ダウンロード

Go To PDF Page


リンク URL



ALLDATASHEETはお客様のビジネスに役立ちますか?  [ DONATE ] 

Alldatasheetは   |   広告   |   お問い合わせ   |   プライバシーポリシー   |   データシートへのリンク    |   リンク交換   |   メーカーリスト
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