Can I convert TDM 4 channels input to I2S 4 channels output in two independent clock? TDM clock is from external clock, and I2S is internal clock in blackfin 592? or I can only get the signals output with noise.
1) I have a project that it can receive the TDM signal and transmit it to I2S, the source of TDM is from TI PCM4104, output of which is lined to sport1 in blackfin.
2) Yes, I can receive the TDM format using TDM code example in visualdsp in SPORT1, then I want to use I2S example to transmit it out of SPORT0. Because I think I can not use only SPORT1 as both input and output. (I think input and output will be under TDM mode, after configuring TDM for SPORT1, and Rclock and Tclock will be together internally, maybe I am right), so I decide to use SPORT1 as input for TDM, and SPORT0 as output for I2S data and its own clock, DMA is in mid of two of them. But it causes some errors.
1) Yes, you can configure one SPORTx to Receive in TDM mode and the other SPORTx to transmit in I2S mode.
2) Are you getting errors when transferring data to DAC? Can you share the screen shot the errors?
3) Can you share the SPORT status registers? Can you check with external clock for I2S mode?
2) Yes，my signal contains glitches like below figure, and the actual condition of signals worse, and signals are not distributed to SPORT0 primary and secondary respectively, 4 channels can go out randomly from array iRxBuffer1, rather than iRxBuffer1 corresponding to channel 0, iRxBuffer corresponding to channel 1 and so on.
I check the program, once I enable SPORT0 to I2S output in the program after I set SPORT1 as TDM input, it will be the figure below, because the input signals in TDM contains glitches, and meanwhile I have to enable the SPORT1 as output, unless there is no data into the TDM input.
So I am not sure where it is errors.
3)I share the sport register in sport.c file, and update the program, and I check the TDM clock for input and I2S clock for output, TDM clock is from external clock 12.288Mhz and FS is 48kHz and I2S clock is from inside of the blackfin DSP, 3.072Mhz and Fs is 48Khz.0654.BL592_TDM_I2S.zip
Sorry for the delay in response.
1) When checking the shared screen shots. These signals are not corresponding to TDM or I2S format. Are you getting proper data from I2S or TDM signal?
2) Before converting to I2S mode. Is it properly worked with TDM mode?. Can you make separate function for TDM and I2S mode? Can you try with the I2S SPORT with external clock?
3) Why the SPORT1(TDM mode) transmiter also enabled in "Enable_DMA_Sport1" function? Please share screen shots with SPORT clock, frame sync and data with name for the scope signals.
4) Can you try with DMA stop mode?
5) Please refer the below ezone thread for reference.