Post Go back to editing

Port0 (or Port1 out) be the clock master and Port1 input be a slave without physically wiring the clock pins between them — i.e. let the DSP sync internally?

Thread Summary

The user asked about configuring the ADAU1467 DSP to receive and transmit I2S data from multiple codecs without physically connecting the clock pins. The solution involved setting the serial input port to 4 channels and ensuring the correct configuration of the SDATAIO pins. For dynamic volume/mute control using an external MCU via SPI, the user needed to send the correct SPI messages, which were confirmed to work after verification with SigmaStudio's Capture window.
AI Generated Content
Category: Software
Product Number: ADAU1467

Hi 

I am using  below setup 

- Serial Output port -1 as master

- LRCK_OUT1 & BCLK_OUT1 are connected to codec

- SDATA_OUT1 driving 2ch (I2s) data to codec (SDATA_OUT1 --> CODEC_DIN)  

Now i am trying to read  serial data from same codec (SDATA_IN1 <-- CODEC_DOUT) , how to achieve this without physically connecting LRCK_IN1 & BCLK_IN1 ? 

means 

can   Port1-out be the clock master and Port1-input be a slave without physically wiring the clock pins between them — i.e. let the DSP sync internally?

or should I connect LRCK_OUT1 --> LRCK_IN1  & BCLK_OUT1-->BCLK_IN1 ?

regards

nagendra 

Parents
  • Hello Nagendra,

    Just set the input port 1 as master and let the BCLK_IN and LRCLK_IN1 unconnected and connect the SDATA_IN1 to CODEC_DOUT. Since the CODEC uses BCLK_OUT1 and LRCLK_OUT1 for syncing, it just works for the input port too. Because serial output clocks and input clocks are derived from internal clocks, it will be the same. The serial input data from CODEC will be properly clocked in.

    I assume the CODEC uses single set of clocks for CODEC's serial input and output.

    Hope you can understand what I'm saying. Let me know if you have any questions.

    Regards,

    Harish

  • hello Harish 

    my requirement is more complex that i explained, i actually want to understand the capability of DSP ADAU where i need to get multiple I2S (2ch data) from various slave codecs , so planning to use SDATAIOX pins as well , in this context 

    out-port1 as master 

    bclk_out1 & LRCK_out1 --> 3x codecs (ADAU is master) 

    data_out-1 ---> codec 1 

    sdataio-1 --> codec 2 

    sdataio-2 --> codec 3

    now the issue is Input , how to mange , all 3 codecs has Dout  as well 

    so planning to use

    IN-Port-1 as input , configuring as slave, 

    bclk_in-1 & LRCK_in-1 are NC (not connected) 

    data-in-1  <--- codec 1 

    sdataio-3 <--- codec 2

    sdataio-4 <--- codec 3 

    can I use the way i have explained with out connecting BCLK_out-1 and LRCK_out-1 with  BCLK_IN1 and LRCK_IN1 ?

    can ADAU sync internally by selecting LRCK source as "slave from clock domain 1/2/3 etc" ? 

    i tried my best to explain, is my configuration works ? wat is the use of "slave from clock domain 1/2/3" ? setting ?

    regards

    Nagendra 

      

  • Hello Dave 

    thanks a lot for your explanation, I believe I got some clarifications. 

    now what i tried was, 

    - configured serial-in-port-1  as master , but I did not connect BCLK_in1 and LRCK_in1 they are floating 

    - now connected Codec DataOut to SDATA_IN1 and able to received Audio data well from my codec on channels 16 & 17 in Sigmastudio

    I have probed LRCK_IN-1 and LRCK-OUT-1 and they are perfectly in Sync , even BCLK as well.  

    (Both Serial Port-IN-1 and Serial-port-out-1 are master) 

    this solved my issue partially.. 

    But I am not able to receive serial data from SDATAIO2 on input channel 20&21 of sigma studio even after below configuration 

    (connected codec Dout to SDATAIO2 instead of SDATA_IN for testing)  

    kindly help me 

    regards

    nagendra 

  • Hello nagendra,

    There are many places where one register setting might mess this up. 

    From what you wrote above I want to double check that all of these serial data streams are I2S formatted data? So stereo and 32 bit wide slots etc. Correct?

    So please send over your project. 

    I have an example file for our eval boards. This one uses serial port 2 but the idea is the same. Here is the setting in the SDATAIO registers. It will look familiar to you. 

    Serial input port 2 is setup this way:

    Then in the project I pick up the audio this way: (keep in mind I was using port 2 not port 1. )

    Yes, there are some illogical register settings telling to use TDM4. This is because internally we do that but the signal coming in on the eval board were stereo I2S. 

    In addition, do not forget to change the MP pins to the correct usage. (I have been guilty of that oversight!!! LOL)

    See if this helps. 

    Otherwise, send over your project.

    Dave T

  • hello Dave

    below is my port-in-1 setting 

    I am able to receive 2 ch data from SDATA_IN1 well 

    but i need to receive 2 more channels form SDATAIO-1 from another codec 

    if i change the channels to 4 , 32 bit per channel , my BCLK is doubled and this is effecting codec 

    I guess there is a confusion here, why i need to change to 4 channel ? 

    for PORT-1-OUTPUT to driver 6 channels independent i did not change this setting at all, still i am able to driver 6 different channels on port1-0-output 

    SDATA_OUT1 => 2 ch 

    SDATAIO-2  => 2 ch

    SDATAIO-3 => 2 ch 

    similarly : my target is to capture 6 channel audio from PORT-1-IN

    to receive more channels on IN_PORT_1 need to change channel configuration which is effecting Bit clock , which is not intended for my design , so can you please check below schematic and guide me how to configure in SS ?

    target :

    - drive 3 set of  stereo channels to 3x codecs independently  

    - receive 3 set of  stereo channels from same codecs 

    - using INPUT PORT-1 and OUTPUT PORT-1  with extra SDATAIOX pins 

    each codec support LRCK (I2S) , BCLK, DIN and DOUT only , No separate clocks for DIN and DOUT for Codec

    regards

    nagendra 

  • Hello nagendra,

    There is an internal bug and I think you missed one little detail. Your connection setup should be fine. You are driving the LRCLK and BCLK from the serial output port. Do NOT change that port to be four channels. ONLY change the serial input port to 4 channels. 

    That port according to your diagram does not go to the codecs so it should not be a problem.

    Only set serial input port 1 for 4-channels. 

    Dave T

  • Hello Dave 

    thank you  for clarification

    so, to receive more channels on serial-port-in-1 , I have to configure "serial input port " to 4 channel , its clear, and its working tested with Serial-IN-2 port on EVK (I am sure same would applicable to Port-IN-1) 

    just one clarification, the above schematics should work well, even Port-IN-1 is configured as salve right ? (to be tested ) 

    regards

    nagendra 

  • Hello nagendra,

    Yes, port configuration would be the same with the exception of the difference between Input port 1 and input port2. Assuming you are starting the numbering as we did in the datasheet with input port 0. So ports 0 and 1 can go up to TDM16 or, 16 inputs. Serial ports 2 & 3 can only go up to TDM8. So in your case using the SDATAIO pins you will only be able to get four channels into serial input port 2. You set it up for TDM-4 and get two channels from each set of four. 

    Whether the serial port is a clock slave or master makes no difference with how it works. Assuming the clocks are correct. IF the clocks are from a source that uses a different MCLK then you will have to route the signal through an ASRC but that is after the serial port. 

    Dave T

  • Hello Dave 

    sorry for late reply. thanks for your inputs and your inputs helps a lot, 

    Now I am able to configure  the DSP as per my requirement and all audio channels are up and running 

    now my target is to control volume/mute options dynamically using external MCU systems 

    1. developed schematics in SigmaStudio and flashed to EEPROM

    2. on reset DSP boots with EEPROM, and all interfaces are up and running 

    3. I have a mute control in schematics with address 0x0044 for one of the output 

    4. to control this dynamically i have connected an external MCU to J1 of my Eval kit (ADAU1467) and trying to write address 0x0044 and data 0/1 (mute/unmute) , but  I could not see any change in the output , 

    5. I confirm my HW configuration is good, probed SPI interface and confirmed with Scope 

    any help on  "how to configure registers dynamically using external MCU via SPI? "  

    evk used : ADAU-1467Z

    regards

    Nagendra 

  • Hello Nagendra,

    Can you supply more detail as to the exact SPI messages you are sending out? I assume you have clicked on the mute button when operating it from SigmaStudio and watched the address going out in the Capture window? 

    My first suspicion is you may not be sending the correct number format for a zero and a one? 

    The capture window shows all the info. 

    Dave T

  • Hello Dave,

    yes, I verified mute address and functionality in Capture window before playing with MCU-SPI below is the screen capture with SigmaStudio

    Then I have disconnected Sigmatudio and connected the MCU  SPI to J1 of Eval Kit 

    HW connections : 

    J1-7 - CLK --> MCU SPI CLK 

    J1-10 - GND --> MCU SPI - GND

    J1-9 - SS# - 9  --> MCU SPI - CS 

    J1-8 - MOSI --> MCU SPI - MOSI

    I am writing 6 bytes ( 2 bytes address 00 44 4 bytes value 00 00 00 01 or 00 00 00 00 ) 

    ex: 

    def write(addr, data):
    tx = [
    (addr >> 8) & 0xFF,
    addr & 0xFF,
    (data >> 24) & 0xFF,
    (data >> 16) & 0xFF,
    (data >> 8) & 0xFF,
    data & 0xFF
    ]
    spi.xfer2(tx)

    let me know if you need any specific input 

    -Nagendra 

  • Hello Dave 

    any inputs here ?

    regards

    Nagendra 

Reply Children