RM0430
To secure a continuous audio data transmission, it is mandatory to write the SPIx_DR
register with the next data to transmit before the end of the current transmission. An
underrun flag is set and an interrupt may be generated if the data are not written into the
SPIx_DR register before the first clock edge of the next data communication. This indicates
to the software that the transferred data are wrong. If the ERRIE bit is set into the SPIx_CR2
register, an interrupt is generated when the UDR flag in the SPIx_SR register goes high. In
this case, it is mandatory to switch off the I
left channel.
To switch off the I
BSY = 0.
Reception sequence
The operating mode is the same as for the transmission mode except for the point 1 (refer to
the procedure described in
set the master reception mode using the I2SCFG[1:0] bits in the SPIx_I2SCFGR register.
Whatever the data length or the channel length, the audio data are received by 16-bit
packets. This means that each time the RX buffer is full, the RXNE flag in the SPIx_SR
register is set and an interrupt is generated if the RXNEIE bit is set in the SPIx_CR2
register. Depending on the data length and channel length configuration, the audio value
received for a right or left channel may result from one or two receptions into the RX buffer.
The CHSIDE flag is updated each time data are received to be read from the SPIx_DR
register. It is sensitive to the external WS line managed by the external master component.
Clearing the RXNE bit is performed by reading the SPIx_DR register.
For more details about the read operations depending the I
refer to
Section 29.6.2: Supported audio
If data are received while the preceding received data have not yet been read, an overrun is
generated and the OVR flag is set. If the bit ERRIE is set in the SPIx_CR2 register, an
interrupt is generated to indicate the error.
To switch off the I
the last RXNE = 1.
Note:
The external master components should have the capability of sending/receiving data in 16-
bit or 32-bit packets via an audio channel.
2
29.6.6
I
S status flags
Three status flags are provided for the application to fully monitor the state of the I
Busy flag (BSY)
The BSY flag is set and cleared by hardware (writing to this flag has no effect). It indicates
the state of the communication layer of the I
When BSY is set, it indicates that the I
master receive mode (I2SCFG = 11) where the BSY flag is kept low during reception.
The BSY flag is useful to detect the end of a transfer if the software needs to disable the I
This avoids corrupting the last transfer. For this, the procedure described below must be
strictly respected.
The BSY flag is set when a transfer starts, except when the I
Serial peripheral interface/ inter-IC sound (SPI/I2S)
2
S, by clearing the I2SE bit, it is mandatory to wait for TXE = 1 and
Section 29.6.5: I2S slave
2
S in reception mode, I2SE has to be cleared immediately after receiving
2
DocID029473 Rev 3
2
S and to restart a data transfer starting from the
mode), where the configuration should
2
S Standard-mode selected,
protocols.
2
S.
S is busy communicating. There is one exception in
2
2
S bus.
S is in master receiver mode.
2
S.
941/1284
953
Need help?
Do you have a question about the STM32F413 and is the answer not in the manual?
Questions and answers