AnsweredAssumed Answered

LPC4088 as I2S Transmitter Slave 4-wire with SGTL5000

Question asked by Alejandro Fachini on Dec 12, 2019
Latest reply on Dec 13, 2019 by Felipe García

Hello I cant transmit as Slave with 4-wire using I2S.

Electrical Setup using LPCQuickStartBoard rev B:

SGTL5000_DOUT to LPC4357_RX_SDA p17 (P0.25)

SGTL5000_DIN to LPC4357_TX_SDA p11 (P0.9)

SGTL5000_SCK to LPC4357_RX_SCK p15 (P0.23)

SGTL5000_WS to LPC4357_RX_WS p16 (P0.16)

 

SGTL is in Master Mode:

SCK is 512 Khz (scope tested)

WS is 8kHz (scope tested)

Fs is kHz (programmed into SGTL5000)

SGTL is using PLL with a 24 MHz oscilator

SGTL is transmitting noise because i have mic multiplexed to I2S out

I need to Play sound from LPC to SGTL, i cant seems to send data.

 

From UM10562 Section 23 the setups i need for this to work are:

Reception Fig 136 Typicalreceiver Slave mode using 3 pins as Input

    I2S_RX_CLK

    I2S_RX_SDA

    I2S_RX_WS

I2SDAI[5]=1

I2SRXMODE[3:0]=0000

IOCON register is also correctly asigned to function.

FOR NOW NO DMA IS INTENTED TO BE USED

Transmission Fig 132 4-wire transmitter slave mode sharing the receiver bit clock and WS, uses one Pin as Output:

    I2S_TX_SDA

    Clock is derived from RX bit clock
    WS is derived from RX_WS

I2SDAO[5]=1

I2STXMODE[3:0]=0100

IOCON register is also correctly asigned to function.

FOR NOW NO DMA IS INTENTED TO BE USED

 

When i run the program in debug mode and send a byte to the TXFIFO i get  the interrupt but no byte is sent to the pin.

Using direct write to the FIFO: LPC_I2S->TXFIFO = 0x55; produces no output even when the ISR ins triggered and also the TX Interrupt fifo level is set to 1

Here is my code using a Library from mbed 

 

I2S* i2s_tx = new I2S( I2S_TRANSMIT, p11, true );
i2s_tx->frequency(8000);
i2s_tx->wordsize(16);
i2s_tx->stereomono(I2S_STEREO);
i2s_tx->masterslave(I2S_SLAVE);
i2s_tx->set_interrupt_fifo_level(1);
int yes = i2s_tx->setup_ok();
i2s_tx->attach(&SGTL5000::I2S_TxData);//callback to the ISR interrupt call
i2s_tx->start();
int datotest[]={5};
i2s_tx->write(datotest, 1); //send one data

 

I suspect that there is some missing config in the 4-wire mode. When i check the registers using the path from UM10562 Fig.139 "I2S clocking and pin connections" the values seems correct.

 

My question is Do i need to configure an RX object before using the TX 4-wire mode? or it can be independant?

The data is not showing in TX SDA

 

Regards

Outcomes