29.01.2015 Views

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

STM32F101xx, STM32F102xx, STM32F103xx, STM32F105xx and ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Serial peripheral interface (SPI)<br />

RM0008<br />

23 Serial peripheral interface (SPI)<br />

Low-density devices are <strong>STM32F101xx</strong>, <strong>STM32F102xx</strong> <strong>and</strong> <strong>STM32F103xx</strong><br />

microcontrollers where the Flash memory density ranges between 16 <strong>and</strong> 32 Kbytes.<br />

Medium-density devices are <strong>STM32F101xx</strong>, <strong>STM32F102xx</strong> <strong>and</strong> <strong>STM32F103xx</strong><br />

microcontrollers where the Flash memory density ranges between 64 <strong>and</strong> 128 Kbytes.<br />

High-density devices are <strong>STM32F101xx</strong> <strong>and</strong> <strong>STM32F103xx</strong> microcontrollers where the<br />

Flash memory density ranges between 256 <strong>and</strong> 512 Kbytes.<br />

Connectivity line devices are <strong>STM32F105xx</strong> <strong>and</strong> STM32F107xx microcontrollers.<br />

This section applies to the whole STM32F10xxx family, unless otherwise specified.<br />

23.1 SPI introduction<br />

In high-density <strong>and</strong> connectivity line devices, the SPI interface gives the flexibility to get<br />

either the SPI protocol or the I 2 S audio protocol. By default, it is the SPI function that is<br />

selected. It is possible to switch the interface from SPI to I 2 S by software.<br />

In low- <strong>and</strong> medium-density devices, the I 2 S protocol is not available.<br />

The serial peripheral interface (SPI) allows half/ full-duplex, synchronous, serial<br />

communication with external devices. The interface can be configured as the master <strong>and</strong> in<br />

this case it provides the communication clock (SCK) to the external slave device. The<br />

interface is also capable of operating in multimaster configuration.<br />

It may be used for a variety of purposes, including Simplex synchronous transfers on two<br />

lines with a possible bidirectional data line or reliable communication using CRC checking.<br />

I 2 S is also a synchronous, serial communication interface with a 3-pin protocol. It can<br />

address four different audio st<strong>and</strong>ards including the I 2 S Phillips st<strong>and</strong>ard, the MSB- <strong>and</strong><br />

LSB-justified st<strong>and</strong>ards <strong>and</strong> the PCM st<strong>and</strong>ard. It can operate in slave or master mode with<br />

half-duplex communication. Master clock may be provided by the interface to an external<br />

slave component when the I 2 S is configured as the communication master.<br />

Warning:<br />

Since some SPI3/I2S3 pins are shared with JTAG pins<br />

(SPI3_NSS/I2S3_WS with JTDI <strong>and</strong> SPI3_SCK/I2S3_CK with<br />

JTDO), they are not controlled by the I/O controller <strong>and</strong> are<br />

reserved for JTAG usage (after each Reset).<br />

For this purpose prior to configure the SPI3/I2S3 pins, the<br />

user has to disable the JTAG <strong>and</strong> use the SWD interface<br />

(when debugging the application), or disable both JTAG/SWD<br />

interfaces (for st<strong>and</strong>alone application). For more information<br />

on the configuration of JTAG/SWD interface pins, please refer<br />

to Section 8.3.5: JTAG/SWD alternate function remapping.<br />

586/995 Doc ID 13902 Rev 9

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!