Post Go back to editing

DSP freezes for LRCLK_IN and BCLK_IN tied with LRCLK_OUT and BCLK_OUT

Category: Hardware
Product Number: ADAU1401

I am trying to connect the ADAU1401 digital audio input and output to an STM32H7 microcontroller. I am setting the ADAU1401 as I2S master to transmit and receive audio streams. I've read in the datasheet that I should physically tie LRCLK_IN with LRCLK_OUT and BCLK_IN with BCLK_OUT. I have done this. The problem happens when configuring the GPIO registers in SigmaStudio. After setting MP4 pin as LRCLK_IN, when I set MP10 as LRCLK_OUT the DSP seems to freeze (no audio out in the DAC and the LED connected to MP2 does not respond anymore). 

How should I properly set the GPIO registers for this case?

Below is a screenshot of the Hardware Configuration. When I set MP10 as LRCLK_OUT the DSP freezes. The same happens if I set LRCLK_OUT and after LRCLK_IN. The order does not matter.

And here is a screenshot of the schematic (just for testing). Audio is working fine through ADC and DAC: 

Sorry if the images are not rendering properly. I couldn't insert images directly in this post, do not know why. This is my first post here.

Best Regards,

Miguel Moreto

Parents
  • Hello Miguel,

    I looks like you are trying to run the serial port at a sample rate of 192kHz and the DSP is running at 48kHz. I do not know the frequency of your crystal but I assume it is most likely 12.288MHz and you have the PLL pins set to 256x. 

    I can see the settings in the serial output port which are clearly set for 192kHz. The DSP Core Program Length is clearly set to 1x (1024 instructions) which is 48kHz. n this DSP if frequencies do not match up correctly coming into the serial port it just mutes everything. Usually people apply clocks that were not derived from the same master clock but in your case you are operating the serial port as a master so that is not the issue. I think it is the sampling rates. 

    You did not attach your project so I have no idea what the project is set for as far as sample rates. Getting sample rates to be correct is a three-legged stool. You need the correct setting at the top of SigmaStudio, you need registers properly set and you need to be applying the correct clock frequencies to the part. If any one of these is wrong then the stool falls over. 

    Also, the screenshot you provided of your project had no digital input signal path. I suppose you had plans to add it but never got that far. 

    I attached one of my example projects that is tested and works. You need to externally jumper the SDATA out back into the SDATA In and you will get it all to work. 

    6646.ADAU1701 Digital Out with Digital In Loopback test.dspproj

    DaveT

Reply
  • Hello Miguel,

    I looks like you are trying to run the serial port at a sample rate of 192kHz and the DSP is running at 48kHz. I do not know the frequency of your crystal but I assume it is most likely 12.288MHz and you have the PLL pins set to 256x. 

    I can see the settings in the serial output port which are clearly set for 192kHz. The DSP Core Program Length is clearly set to 1x (1024 instructions) which is 48kHz. n this DSP if frequencies do not match up correctly coming into the serial port it just mutes everything. Usually people apply clocks that were not derived from the same master clock but in your case you are operating the serial port as a master so that is not the issue. I think it is the sampling rates. 

    You did not attach your project so I have no idea what the project is set for as far as sample rates. Getting sample rates to be correct is a three-legged stool. You need the correct setting at the top of SigmaStudio, you need registers properly set and you need to be applying the correct clock frequencies to the part. If any one of these is wrong then the stool falls over. 

    Also, the screenshot you provided of your project had no digital input signal path. I suppose you had plans to add it but never got that far. 

    I attached one of my example projects that is tested and works. You need to externally jumper the SDATA out back into the SDATA In and you will get it all to work. 

    6646.ADAU1701 Digital Out with Digital In Loopback test.dspproj

    DaveT

Children
  • Dear Dave,

    thanks a lot for pointing out the wrong sampling rate setting. It is working now (at least it is no stopping anymore). I didn't tested the serial port with your exemple yet. But I will. I new from start that it should be a rookie mistake from my part. I calculated the Frame Sync and Bitclock divisions based on the frequency Fs * 256 (that is the PLL setting). I didn't take into account that the Internal Clock is actually Fs * 1024 and not 12.288Mhz (as you correctly assumed this is the crystal frequency I have here).

    Best regards!

    Miguel