kinetis i2s receiver in slave mode

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

kinetis i2s receiver in slave mode

787件の閲覧回数
romanrumian
Contributor I

Dear friends,

I do not want to use DMA or interrupts, and just want receive a stream of stereo samples by pooling some status flag.

Is it possible ? Which flag should I test ?

I use KDS3 and Processor Exper for I2S configuration.

Regards

Roman

ラベル(1)
0 件の賞賛
返信
3 返答(返信)

598件の閲覧回数
EarlOrlando
Senior Contributor II

Hello Roman,

Which MCU are you using?

Best regards,

Earl.

0 件の賞賛
返信

598件の閲覧回数
romanrumian
Contributor I

Hi Earl,

I use FRDM-K22F demo board.

On monday I successfuly programmed I2S using PE (transmitter is an asynchronous master, and the receiver asynchronous slave).

Use separate pins for bclk, fs and data signals in transmitter and receiver, and connected them by 3 wires.

I did this because transmitter simulates external audio codec (master).`

I test FRF (FIFO Ready Flag) in both: receiver and transmitter, but it seems me, that have data errors (multiple copies of the same data).

int    i,j,x;
int rdata[0x100];

  for(;;){

      j=0;

      for(i=0;i<0x2000;i++){

      while(I2S0_TCSR&I2S_TCSR_FRF_MASK == 0U) {};

      I2S0_TCSR|=I2S_TCSR_FRF_MASK;

   I2S0_TDR0 = i;

      while(I2S0_RCSR&I2S_RCSR_FRF_MASK == 0U) {};

      I2S0_RCSR|=I2S_RCSR_FRF_MASK;

//      x=I2S0_RDR0;

      if(j<0x100) rdata[j++]=I2S0_RDR0;

      else {j=0; rdata[j++]=I2S0_RDR0;}

      }

  }

By the way, what is a data channel ?

In control register 3 (I2Sx_TCR3) there are 2 TCE "Transmit Channel Enable" bits [16:17], but checkbox in PE sets only one [16].

I want to have a pass-through application (receiver data -> transmitter data), so the receiver should be asynchronous slave (fs, bclk external from pins) but what about transmitter ?

Synchronous with the receiver ?

From audio codec have only one bclk, but separate fs (ADCLRCLK, and DACLRCLK).

Thank you :-)

Roman

0 件の賞賛
返信

598件の閲覧回数
EarlOrlando
Senior Contributor II

Hello Roman,

Every I2S instance has two data channels, each channel has its own FIFO so you could transmit different data through each channel. It is something like say that every instance has two instances but with the same configurations such sampling frequency, etc. PE by default enables just one channel because it is the most common case.

Regards,

Earl.

0 件の賞賛
返信