We had this topic already more than a month ago, right?
You're wiring looks good. You only need to set the registers correctly.
You need to consider the following: MCLK does not necessarily belong to the I2S interface. It is the system clock for the audio codec, according to the NAU8812 data sheet it can be any clock between 8MHz and 33MHz. So when the User Manual talks about 4-wire interface, then it's the 4 wires SCK / WS / RX_SDA / TX_SDA.
Having the MCLK on top in phase with these signals is maybe a good option, so providing it from the LPC4300 side is for sure the best solution. Using the audio PLL inside the LPC4300, you can already generate a suitable system clock for the codec and you don't need to use the fractional PLL from the NAU8812.
The UDA1380 could work with this MCLK as well, but has also the option to generate its own system clock with a PLL, based on the FrameSync clock input.
The question is now whether you need to realize input/output or only output. The so called 4-wire mode is the minimum setup for an RX/TX interface. If you also supply MCLK to the codec then this is the fifths wire.
Let's assume the LPC4300 is the I2S master and you use RX/TX in the 4-wire mode:
- You need 4 signals: TX / RX / SCK / WS
- The WS signal is used for framing both RX and TX data, both are bit-sampled with the SCK signal
- We can decide to use TX_SCK and TX_WS as timing signals, but RX_SCK and RX_WS is an option as well. This makes it maybe so complex to understand. The transmitter and the receiver could work independently from each other, each with own SCK and WS signals. They could work even with a different format. But in most setups you don't need this, the transmitter and the receiver should use the same timing anf the format for RX/TX is thew same, so settings in register DAO and DAI are the same.
- If you look to the discrete figures 152 and 159 you might not see the greater context
- When you go to Fig. 147 where all 8 pins are shown, you simply remove either pins I2S_TX_MCLK / I2S_TX_SCK / I2S_TX_WS or I2S_RX_MCLK / I2S_RX_SCK / I2S_RX_WS and take care that the register settings in DAO / DAI / TXMODE / RXMODE are correct for your setup.
- You operate the I2S0 interface as master (for both transmitter and receiver), so the timing SCK and WS comes from the LPC4300. You supply these two signals to the codec and you use these signals inside the LPC4300 to transmit data and to receive data.
Hope this helps a little bit.