09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

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

<strong>RM0090</strong> Serial peripheral interface (SPI)<br />

In Slave mode (Figure 273: TI mode - Slave mode, single transfer and Figure 274: TI mode -<br />

Slave mode, continuous transfer), the SPI baud rate prescaler is used to control the moment<br />

when the MISO pin state changes to HiZ. Any baud rate can be used thus allowing to<br />

determine this moment with optimal flexibility. However, the baud rate is generally set to the<br />

external master clock baud rate. The time for the MISO signal to become HiZ (t release )<br />

depends on internal resynchronizations and on the baud rate value set in through BR[2:0] of<br />

SPI_CR1 register. It is given by the formula:<br />

tbaud_rate --------------------- + 4× tpclk < trelease <<br />

2<br />

Note: This feature is not available for Motorola SPI communications (FRF bit set to 0).<br />

To detect TI frame errors in Slave transmitter only mode by using the Error interrupt (ERRIE<br />

= 1), the SPI must be configured in 2-line unidirectional mode by setting BIDIMODE and<br />

BIDIOE to 1 in the SPI_CR1 register. When BIDIMODE is set to 0, OVR is set to 1 because<br />

the data register is never read and error interrupt are always generated, while when<br />

BIDIMODE is set to 1, data are not received and OVR is never set.<br />

Figure 273. TI mode - Slave mode, single transfer<br />

Figure 274. TI mode - Slave mode, continuous transfer<br />

NSS<br />

input<br />

SCK<br />

input<br />

MOSI<br />

input<br />

MISO<br />

output<br />

NSS<br />

input<br />

SCK<br />

input<br />

MOSI<br />

input<br />

MISO<br />

output<br />

trigger<br />

edge<br />

sampling trigger<br />

edge edge<br />

sampling<br />

edge<br />

t baud_rate<br />

2<br />

--------------------- + 6× tpclk trigger<br />

edge<br />

t Release<br />

sampling<br />

edge<br />

DONTCARE MSBIN<br />

LSBIN DONTCARE<br />

1 or 0 MSBOUT LSBOUT<br />

trigger sampling trigger sampling trigger sampling<br />

ai18434<br />

DONTCARE MSBIN<br />

LSBIN MSBIN LSBIN DONTCARE<br />

1 or 0 MSBOUT LSBOUT<br />

MSBOUT LSBOUT<br />

FRAME 1 FRAME 2<br />

ai18435<br />

Doc ID 018909 Rev 3 798/1416

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

Saved successfully!

Ooh no, something went wrong!