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.

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

Figure 300. Operations required to receive 0x3478AE<br />

Figure 301. LSB justified 16-bit extended to 32-bit packet frame with 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. In this case it corresponds<br />

to the half-word MSB.<br />

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

the operation shown in Figure 302 is required.<br />

Figure 302. Example of LSB justified 16-bit extended to 32-bit packet frame<br />

In transmission mode, when TXE is asserted, the application has to write the data to be<br />

transmitted (in this case 0x76A3). The 0x000 field is transmitted first (extension on 32-bit).<br />

TXE is asserted again as soon as the effective data (0x76A3) is sent on SD.<br />

In reception mode, RXNE is asserted as soon as the significant half-word is received (and<br />

not the 0x0000 field).<br />

In this way, more time is provided between two write or read operations to prevent underrun<br />

or overrun conditions.<br />

PCM standard<br />

First read from Data register<br />

conditioned by RXNE = ‘1’<br />

0x0034 0x78AE<br />

Only the 8 LSB bits of the half-word<br />

are significant. Whatever the 8 MSBs,<br />

a field of 0x00 is forced instead<br />

16-bit data<br />

0 forced<br />

Channel left 32-bit<br />

For the PCM standard, there is no need to use channel-side information. The two PCM<br />

modes (short and long frame) are available and configurable using the PCMSYNC bit in<br />

SPI_I2SCFGR.<br />

823/1416 Doc ID 018909 Rev 3<br />

MSB LSB<br />

Only one access to SPI_DR<br />

Second read from Data register<br />

conditioned by RXNE = ‘1’<br />

Transmission Reception<br />

0X76A3<br />

16-bit remaining<br />

Channel right

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

Saved successfully!

Ooh no, something went wrong!