Post Go back to editing

Two AD1938 in daisy chain with ADAU1452

Hi, 

I am trying to connect two AD1938 in "daisy chain" mode to one ADAU1452 DSP, but I am stuck... 

The first thing I want to do is to config the hardware registers on both codecs so they can work in "daisy chain". For that I am using USBi and Sigma Studio (SPI). 

USBi is properly connected and detected by Sigma Studio. I am using SPI, so MISO, MOSI, SS and SCL are used between USBi and AD1938. Also, 5volts are provided to the codec. 

When I choose "Get Current Settings from Chip" all AD1938 settings go to default (all muted, disabled, power down, etc.). After that I modify all the settings and choose "Write Current Settings to Chip". Everything seems to be written to the chip, as my capture screen shows the blocks write, and "Downloaded" is shown on the right bottom corner. So far so good.

To verify that settings where written to codec, I now set  "Get Current Settings from Chip" , which should show all the settings I made previously, but instead all goes -again- to default (all muted, disabled, power down, etc.).

When trying this, I am not connected to the DSP, only to the codec.

Any clues what I am doing wrong? 

Thanks

Parents
  • hi mga2009

    I have attached picture  that will help you with schematic, also inside Sigma Studio.

    PS. i left only SPI needed pinson schematic to better undertanding.

  • Rocha, thanks for your reply. 

    Sorry my ignorance, but I can't find pin SCK nor CS in my AD1938 board. 

    If CS = SS and SCK = SCL then, that's the way I was plugin my USBi to the AD1938. 

  • Yes, CS = SS and SCK = SCL

    Please note! each CS/SS must have separated pin, original USBi only have one on 10- pin connector, so on this case you must wire it yourself. as DaveThib says, 

  • Thanks! At least I was connecting that right. 

  • Also, you can use an logic analizer or osciloscope, to check if data/clock/ss is correct on SPI BUS, salae logic is cheaper.

  • Hello mga2009,

    First I want to thank Rocha for the great post!! 

    Yes, CS is Chip Select and SS is Slave Select. It depends on what you are used to and they mean the same thing. SCK and SCL if often a way to differentiate between the SPI clock and the I2C clock but to me it does not matter and I am too dyslexic to keep it straight half the time! So in my book they mean the same thing. The clock for the comms port. 

    It looks like you have the basic connections most likely correct. It depends on ribbons and wires so I cannot be 100% certain. 

    There is an issue with the SS ( or CS, LOL ) on the codec. There needs to be a pull up resistor on it to keep the codec from going into standalone mode. If the SS, SCL, and MOSI lines are all low for more than around 3ms then it will go into standalone mode and ignore most of your writes to the part. However, you will still be able to read and write but many of the settings will be ignored. It will stay this way as long as it is powered up. Although I am pretty sure a hard reset will fix it. 

    I also suggest you obtain one of our USBi boards for testing. Yours is a big unknown. You could look at the SPI lines with a scope to decode what is being sent if you like to be certain your USB interface is actually sending out the correct data. 

    Then I could not help to notice that your codec PCB will probably have some issues with the PLL locking and noise floor will not be good. The locations of the bypass caps with relation to the chip is not good. Then the PLL loop filter needs to return to the power pin right next to the LF pin. The way you are doing VIAS is not good. I do not know if you have four layers on your board but you should. Download and take a look at the ADAU1452 datasheet. Near the end there is a layout example. Look at how the bypass caps are connected and do it that way. Also, if you have a copper ground fill on the top of the board that is under the part do not tie it to any of the ground pins on the part. Let the ground fill be grounded to the ground plane using vias and let the pins get their grounds by first passing by a bypass cap to then go to a via. 

    Then the serial data lines over to the codec should have grounds on every other pin so when you use a ribbon cable there is a ground wire next to each clock and data line. If you do not do this you will have trouble if you want to use a higher sampling rate. 

    Then last, for the codec registers. You need to use the PLL and you must enable the internal MCLK. If you do not then the part will be a doorstop. I know, I have tested this in the lab. LOL. I have sat there for several minutes wondering why it is not working only to find the internal clock is not enabled. 

    I would also enable the HPF in the ADC section. Get rid of the DC offset right at the ADC to prevent issues inside the DSP later. 

      

    Enough for now.

    Dave T

  • Dave,

    Thanks for your reply. Couple of questions as I am really not that technical... 

    1-. For the pull Up resistor on the SS pin, I just need to connect a 10kOhm resistor to the SS pin and to the 5Volts? That's it?

    2-. Hard Reset means just unplug the codec from power? 

    3-. This is not my PCB design. Is there a way to mitigate this design problem (and have better noise floor) without redesigning the PCB?

    Cheers

  • There is an issue with the SS ( or CS, LOL ) on the codec. There needs to be a pull up resistor on it to keep the codec from going into standalone mode

    Dave,

    Also, If I understand correctly (probably a BIG NOT), from this page:
    Stand-alone Modes on the AD193x audio CODECs - Documents - Audio - EngineerZone (analog.com)

    The pin I need to pull up to avoid standalone mode is COUT = MISO not SS (CLATCH).

    I tired the SS to 5V with a 10kOhm resistor and it made no difference.

Reply Children
  • Hello mga2009,

    First DO NOT tie the resistor to 5V. MAX is 3.3V on this part. 

    It is the CLATCH pin that you have to pull up.

    You must have this resistor there to avoid entering the StandAlone mode when you do not want to. You can still possibly enter this mode if you hold all the control lines low for too long. I explained all this earlier.

    From your earlier questions:

    Yes, shutting off the power will be a hard reset. But there is also a reset pin which is also a hard reset. 

    3-. This is not my PCB design. Is there a way to mitigate this design problem (and have better noise floor) without redesigning the PCB?

    Basically No. There might be a few things like tacking in a few caps or shorting a few ground planes to help a little but it is difficult to fix in that way. Kind of like trying to make a race car out of a cheap small production chassis. 

    Now this thread has been going on for a while now. It would be good to reconnect with the actual problem you are having?

    Dave T

  • Dave, 

    Thanks for your help. 

    Still IDK you to properly load the config file from the DSP to my CODEC. 

    I managed to get the codec sequence file using Master Control Port in my SS schematic and properly downloaded to the DSP.

    I am using MP13 for control port.

    Now, I understand this is the basics, but still I don't get it.

    So, my MP13 is my control port, so I have to connect it to my CODEC pcb... but to which pin? Any other pin (besides the control port) is required for this programming?

    My understanding (informed guess), as I am using SPI on my master control, is MP13 goes to CODEC MISO, DSP CS goes to CODEC SS, and DSP SCL/CLK goes to CODEC SCL

    Sequence File