LPC1778 I2S port in slave mode

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

LPC1778 I2S port in slave mode

1,697 Views
FriedrichWaas
Contributor I

Hello,

we are using the LPC1778 controller series for some years with I2S port in master mode and everything works fine.

Due to a necessary change in our DSP, it is necessary to switch the I2S port of LPC1778 from master mode to slave mode. Unfortunately this does not work! There is no data sent on the I2S port and there is no interrupt or DMA-request!

We have made some investigations and it seems that the external I2S_TX_CLK is not connected to the I2S peripheral block.

We feed in the TX-CLK at the pin I2S_TX_CLK and set the I2SDAO[5] to 1 which switches the multiplexer to the external I2S_TX_CLK input. According to the block diagram it should be possible to see the clock at the I2S_TX_MCLK pin if I set the I2STXMODE[3] to 1. But nothing comes out of the pin. If we set the I2SDAO[5] to 0 and setup the fractional divider, we can see the clock frequency at the pin I2S_TX_MCLK.

Is there any special setup necessary to switch to I2S slave mode?

Thank you for any hints!

Labels (2)
0 Kudos
Reply
5 Replies

1,631 Views
FriedrichWaas
Contributor I

Thanks for your reply.

I tryed to change the order of irq init but it doesnt matter. After enabling the i2s-irq the irq-handler will be called once and the loop will fill the tx-fifo until the fifo is full. No data will be sent and the fifo will stay at the filled level.

As attachment nessesarry files for you to chek it.

Hardcopy.png

Thank you very much! 

 

Best regards, Friedrich Waas

0 Kudos
Reply

1,619 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @FriedrichWaas,

Could you please try out the periph_i2s LPCOpen example?

Please modify the example to slave with the recommended configuration. You could download it for the Embedded Artists LPC1788 board here: LPCOpen Software for LPC17XX | NXP Semiconductors

Also, you could try sending other data trough FIFO, or using another pin for I2S configuration, for example, P2[13] for I2S_TX_SDA.

Unfortunately, we do not have an LPC1778 in hand to try out the modifications, looking at your code it seems right, nonetheless, may be worth it try out the example we recommend you. These are the available examples we have for this MXU. We really apologize for the inconveniences.

Best regards, Raul.

0 Kudos
Reply

1,664 Views
FriedrichWaas
Contributor I

Hello Raul,

thank you for your hints.

We have doublechecked our setup with the setup like you described and it is the same.

Here are the screenshot of the settings:

Screenshot 1.jpg

Screenshot 2.jpg

At startup I get an IRQ until the fifo is full.

Clocks on SCK and WS from external peripherals are available.

But: No data output is measurable.

Did we forget some settings or is there a error in the CPU?

Thank you for any hints!

Best regards, Friedrich Waas

 

0 Kudos
Reply

1,642 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @FriedrichWaas,

Could you please share your I2S_IRQHandler() code? Just for double check, are you sending a 32-bit data to TXFIFO for transmition, trough I2S_Send() or similar name?

It seems your slave configuration is correct, so it might be good to review the FIFO transmition. Nevertheless, could you please change the order of lines I2S_IRQConfig() and I2S_IRQCmd() after I2S_Start()?

Best regards, Raul.

0 Kudos
Reply

1,671 Views
RaRo
NXP TechSupport
NXP TechSupport

Hello @FriedrichWaas,

In the LPC178x/7x User manual: Chapter 23. LPC178x/7x I2S Interface. Section 7. I2S operating modes. You may find useful information related with the I2S operation in slave and master modes; in I2S transmit mode, there are conditions to make the I2S to work as slave: I2SDAO[5] it is set to 1 and I2STXMODE[3:0] needs to configure with 0000 for a typical transmitter slave mode, with 0010 for a sharing receive reference clock transmitter slave, or with 0100 for a 4-wire transmitter slave sharing the receiver bit clock and WS.

Note: Configuring the I2S as typical slave transmitter, the clock source is TX_CLK pin as input.

Also, please check the registers for configuring correctly the slave mode for I2S, especially DAO and DAI.

Best regards, Raul.

0 Kudos
Reply