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 />

●<br />

In reception mode:<br />

if data 0x8EAA33 is received:<br />

Figure 215. Receiving 0x8EAA33<br />

First read from Data register<br />

0x8EAA<br />

Second read from Data register<br />

0x3300<br />

Only the 8MSB are right<br />

The 8 LSB will always be 00<br />

Figure 216. I 2 S Phillips st<strong>and</strong>ard (16-bit extended to 32-bit packet frame with<br />

CPOL = 0)<br />

CK<br />

WS<br />

SD<br />

MSB<br />

Transmission<br />

16-bit data<br />

Reception<br />

LSB<br />

16-bit remaining<br />

0 forced<br />

Channel left 32-bit<br />

Channel right<br />

When 16-bit data frame extended to 32-bit channel frame is selected during the I 2 S<br />

configuration phase, only one access to SPI_DR is required. The 16 remaining bits are<br />

forced by hardware to 0x0000 to extend the data to 32-bit format.<br />

If the data to transmit or the received data are 0x76A3 (0x76A30000 extended to 32-bit), the<br />

operation shown in Figure 217 is required.<br />

Figure 217. Example<br />

Only one access to SPI_DR<br />

0X76A3<br />

For transmission, each time an MSB is written to SPI_DR, the TXE flag is set <strong>and</strong> its<br />

interrupt, if allowed, is generated to load SPI_DR with the new value to send. This takes<br />

place even if 0x0000 have not yet been sent because it is done by hardware.<br />

For reception, the RXNE flag is set <strong>and</strong> its interrupt, if allowed, is generated when the first<br />

16 MSB half-word is received.<br />

In this way, more time is provided between two write or read operations, which prevents<br />

underrun or overrun conditions (depending on the direction of the data transfer).<br />

602/995 Doc ID 13902 Rev 9

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

Saved successfully!

Ooh no, something went wrong!