LPC1768 I2S Transmit Problem

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

LPC1768 I2S Transmit Problem

692 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by e135193 on Tue May 05 12:59:38 MST 2015
Hello

      I'm having a transmit problem with my I2S. You can take a look the Tx_WS and Tx_SDA pins as on transmission. There is something wrong with Tx_SDA pin. it only transmits one of the two period of the Tx_WS. I'm using mono,16bit  and 8Khz transmission . It should transmit one half of the Tx_WS but it transmitt on both half of the Tx_WS.

      What could be my problem ? I share my settings.

void I2S_Config(void){
        I2S_ConfigStruct.wordwidth = I2S_WORDWIDTH_16;
I2S_ConfigStruct.mono = I2S_MONO;
I2S_ConfigStruct.stop = I2S_STOP_ENABLE;
I2S_ConfigStruct.reset = I2S_RESET_ENABLE;
I2S_ConfigStruct.mute = I2S_MUTE_DISABLE;
I2S_ConfigStruct.ws_sel = I2S_MASTER_MODE;
I2S_Config(LPC_I2S,I2S_RX_MODE,&I2S_ConfigStruct);
I2S_Config(LPC_I2S,I2S_TX_MODE,&I2S_ConfigStruct);

I2S_Stop(LPC_I2S, I2S_TX_MODE);
I2S_Stop(LPC_I2S, I2S_RX_MODE);

I2S_ClkConfig.clksel = I2S_CLKSEL_FRDCLK;
I2S_ClkConfig.fpin = I2S_4PIN_DISABLE;
I2S_ClkConfig.mcena = I2S_MCLK_ENABLE;
I2S_ModeConfig(LPC_I2S,&I2S_ClkConfig,I2S_TX_MODE);

I2S_ClkConfig.clksel = I2S_CLKSEL_FRDCLK;
I2S_ClkConfig.mcena = I2S_MCLK_ENABLE;
I2S_ModeConfig(LPC_I2S,&I2S_ClkConfig,I2S_RX_MODE);

I2S_FreqConfig(LPC_I2S, 16000, I2S_TX_MODE);
I2S_FreqConfig(LPC_I2S, 16000, I2S_RX_MODE);

I2S_SetBitRate(LPC_I2S, 0x2F, I2S_RX_MODE);
I2S_SetBitRate(LPC_I2S, 0x2F, I2S_TX_MODE);

I2S_IRQConfig(LPC_I2S,I2S_RX_MODE,8);
I2S_IRQConfig(LPC_I2S,I2S_TX_MODE,1);

        I2S_IRQCmd(LPC_I2S,I2S_RX_MODE,ENABLE);
}


void TIMER0_IRQHandler(void){

if (TIM_GetIntStatus(LPC_TIM0, TIM_MR0_INT)== SET)
   {
    if (sample < FRAME_SIZE)
    {
I2S_Send(LPC_I2S, (OUT_Buffer[current_output_buffer][sample]) << 16);
sample++;
    }
    else
    {
        sample = 0;
        if(current_output_buffer)
        {
            current_output_buffer = 0;
             current_decode_buffer = 1;
              }
         else
         {
             current_output_buffer = 1;
             current_decode_buffer = 0;
         }
      }
   }
  
TIM_ClearIntPending(LPC_TIM0, TIM_MR0_INT);
}
Labels (1)
0 Kudos
3 Replies

591 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by lpcxpresso-support on Fri May 08 08:45:43 MST 2015
Where did you look? Download the package for your chip and then look for the periph_i2s example *within the package*.
0 Kudos

591 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by e135193 on Fri May 08 08:23:47 MST 2015
Hello xianghuiwang

     There is no I2S sample project at the link. I take a look at all of the sample project but there is no.

     Could you share a specific example ?

Regards

0 Kudos

591 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by xianghuiwang on Thu May 07 20:28:10 MST 2015
Have you tried the LPCOpen sample project? You can compare the configurations.
http://www.lpcware.com/content/nxpfile/lpcopen-software-development-platform-lpc17xx-packages
Regards!
0 Kudos