Hi, Philipp,
From your brief description, I understand that you have a stream which has TDM format. The frame convers 21 slots, only the first 8 slots have valid data, the other 13 slots have invalid data. You want to acquire the 8 valid slot data and send them out via I2S format, is it correct?
For the input data stream, it is okay to use SAI module to acquire all slots data, you can discard the invalid 13 slots data and only save the 8 valid data to buffer, it is easy.
But you have to output the valid data stream via I2S format, the difficult task is synchronization, the (input bit clock frequency)/(output bit clock frequency)=21/8. Fortunately, the SAI module supports the feature, you can use the SAI transmitter/receiver in asychronous mode, in the case, transmitter and receiver use independent bit clock and frame clock, youn can connect the bit clock of receiver to MCLK, you can set the FRACT=7, DIVIDE=20, you can get the transmitter bit clock which is (7/21)*(receiver bit clock frequency).
In conclusion, you can use SAI receiver to acquire the valid data and save them in buffer. You can connect the Bit clock of SAI receiver to MCLK, use MCLK clock to get the bit clock of SAI transmitter, then use the SAI transmitter to transfer the 8 valid slot data.
Hope it can help you
BR
XiangJun Rong
