09.12.2012 Views

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

RM0090: Reference manual - STMicroelectronics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

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

● In reception mode:<br />

if data 0x8EAA33 is received:<br />

Figure 291. Receiving 0x8EAA33<br />

Figure 292. I 2 S Philips standard (16-bit extended to 32-bit packet frame with<br />

CPOL = 0)<br />

CK<br />

WS<br />

SD<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 293 is required.<br />

Figure 293. Example<br />

First read from Data register<br />

Second read from Data register<br />

0x8EAA 0x3300<br />

Only the 8MSB are right<br />

The 8 LSB will always be 00<br />

Transmission Reception<br />

16-bit data<br />

MSB LSB<br />

Channel left 32-bit<br />

16-bit remaining<br />

0 forced<br />

Only one access to SPI_DR<br />

0X76A3<br />

Channel right<br />

For transmission, each time an MSB is written to SPI_DR, the TXE flag is set and 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 and 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 />

Doc ID 018909 Rev 3 820/1416

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

Saved successfully!

Ooh no, something went wrong!