Post Go back to editing

Setting up correctly EVAL-ADAU1467Z board for higher Fs

Thread Summary

The user is configuring a SigmaDSP board for 192 kHz or 96 kHz sampling rates but encounters issues with the filter cutoff frequency and codec settings. The solution involves changing the CLKGEN1 ratio to 2/3 for 192 kHz and programming the AD1937 codec via I2C to match the desired sample rate. The START_PULSE should remain at 48 kHz, and the codec configuration must be re-applied after each reset or power cycle. The user also needs to ensure the serial input port settings are correct for the number of channels and bit depth used.
AI Generated Content
Category: Software
Product Number: ADAU1467
Software Version: SigmaStudio 4.7

Project : active filtering for hifi.

I'm just at the beginning, but yet confused with clocking configuration.

I intend to run the board at 192 kHz sampling, or 96 kHz.
Changing Fs by dropping down the toolbar selector is not enough, as my filter's cutting frequency turns to be wrong by ×4 or ×2.

I finally succeeded by changing START_PULSE in Hardware config: filter's cutoff is ok.

But in some forum threads I saw this was not the right way to do.
Why?
I'm not even sure codec's i/o's Fs has followed.

So I tried to change CLKGEN1 ratio to 2 / 3, but it turns the board to silence.

Please see my project attached.
That would be great if someone could explain what parameters I missed to change, and give an overview of those involved in the whole chain's sampling frequency.

I would like to understand that and solve this point before going further.

Simple 2 voies sym+asym auto Fs ok.dspproj

Thank you,

Nicolas

  • Hi Nicholas,

    Try starting with a new, empty project, and then select 192 kHz from the drop-down toolbar *before* adding any modules to your project.

    My understanding is that changing the toolbar sample rate *after* a module has been added will not reliably change it's internal settings. As an alternative, you can right-click on each module to inspect the parameters to see if the rate is correct.

    Some versions of SigmaStudio have a menu option to update all modules to the global sample rate, but I don't know whether the version you're running has that.

    All of the above refers to the SigmaDSP itself. Depending upon which DAC is on your board, you may need to supply settings to the DAC to operate at 192 kHz, or 96 kHz, as appropriate. I know that for my custom hardware, I need to supply an XML file with DAC settings to be sent over I2C at startup - otherwise my DAC is not running at the same sample rate as the DSP.

  • Hello Nicolas,

    There are so many ways to setup the SigmaDSP sample rate. It's great that you found out the START_PULSE register changes the actual sample rate of the SigmaDSP hardware.

    The drop down at the top of sigma studio is a software sample rate, the modules which need timing reference like filters, timers, oscillators, compressor etc will use the software sample rate as reference for the calculation to generate the source code. If software and hardware are different, then the timing varies and it won't create expected results.

    So I tried to change CLKGEN1 ratio to 2 / 3, but it turns the board to silence.

    This is because the DAC is programmed for 48kHz by default (standalone mode) and you are giving 192KHz serial clocks to the DAC, so it mutes.

    So, you have to program the CODEC to run at 192KHz, it can be done by sending an XML file from the master control port to program the i2C codec.

    I have attached a project below which will run at 192KHz. Just put the switch S2 to I2C mode and link compile download the project, you will be able to hear audio at 192KHz.

    Eval_ADAU1467_at_192kHz.zip

    Regards,

    Harish

  • Thank you very much for your kind answers.

    What I understand:
    • the whole scheme is compiled using the selected software fs,
    • that does not reach the codec (then ADC & DAC), which is set on its own to 48 kHz,
    • undersampling the serial link to the output works because the codec can undersample,
    • however, oversampling the serial link makes the output silent because the codec can not handle an oversampled signal,
    • and that's exactly what happens when I raise Clock1 from 48 to 96 or 192 kHz.

    What I understand partially:
    • the codec can — and, for consistency, must — be configured to a higher fs, up to 192 kHz,
    • this is done by sending it a config file (XML) at startup.

    What is still unclear:
    • the codec config should be done once, or is it needed on every boot? --> The second, I understand.
    • Then the Codec boot switch will remain in the I2C position? --> Guess yes.
    • Why should the START_PULSE stay at 48 kHz, as it seems to run the DSP computing ?
    • The ParamName sections in the XML are for commentary purpose, or is it read vy the codec?

    Thanks again,
    Nicolas

  • Trying — Succeeds with your project, Harish, but not when inserted into mine: I got white noises or loud noise on one output only, and not consistent results over many runs.

    Is there anything else to touch? I don't see anything special in your project.
    Of course I've changed Clock1 with the 2 / 3 ratio.

    I'm trying to uderstand what is twicked by the XML, regarding AD1937 manual, I stay confused.

    I see we mute the DAC and finally unmute it. Ok.
    But why do we set DAC wordsize to 20 bits ?

    Which of these parameters change the sampling rate?
    Then for 96 kHz, what should be changed?

    Can we take away the default values writing XML lines, or are they all mandatory?

    ...will try again to succeed.

    Thanks

  • As for the XML, you will have to study the data sheet for the AD1937. Page 16 describes the I2C port, and pages 27 through 31 describe the CODEC registers. In addition to those registers, you'll need to understand the various clock and data formatting options that the chip supports. All of the AD1937 settings have to be compatible with the SigmaDSP settings.

  • Hello Nicolas,

    the codec config should be done once, or is it needed on every boot? --> The second, I understand.

    The Codec can be programmed once for it to run continuously, but if you reset the board or give a power cycle then you have to program it again.

    Then the Codec boot switch will remain in the I2C position? --> Guess yes.

    Yes, putting the switch S2 in standalone mode makes the Codec's SCL, SDA pin grounded, which sets the codec at 48KHz default. Please refer the AD1937's datasheet for that info. So, if you want to run the ADC/DAC at different sample rate then you have to program the Codec via its I2C pins, putting switch S2 to I2C mode makes the connection between DSP's master I2C port to codec's I2C port.

    Why should the START_PULSE stay at 48 kHz, as it seems to run the DSP computing ?

    So, if you look at the START PULSE setting carefully, it says, "Base_Fs (48 kHz for 48 kHz base sample rate) (Clock generator 1's x1 output)", it uses CG1's output as is. We made the CG's N/M ratio to 2/3 (288000x2/3 = 192KHz).

    So CG1's output is 192KHz, it's the Base rate now, using CG 1's x1 output gives you 192KHz. You don't change the START PULSE setting, you just change the CG1's ratio will be enough.

    Another method is letting the N/M ratio 'as is' which is1/6 by default. Now CG1 will produce 48kHz, then you have to change the START PULSE and serial ports to Base_Fs*4. which will give you 192KHz. You can see people use this way as well in the forum posts.

    I prefer using the first method, just changing the CG1.

    Now comes, how to program the codec or create the XML file. You can program the codec parameters like sample rate, master/slave, etc. 

    Just open sigma studio and drag/drop AD193x DLL and connect it with USBi and go to hardware registers.

    You can make your required changes in parameter settings and click on the 'X' mark in the capture window like below.

    Then click Link compile download, you can the transaction in the capture window below, just mark all of it and right click and select 'Add to sequence window'.

    Then export the XML files and add it in your Sigma studio program.

    I replaced the DC block with a switch, just trigger it after link compile download, the I2C commands will be sent on your trigger then the CODEC will be programmed and you can listen to the audio.

    There is also a startup boot master control port module that you can try.

    Hope I have answered your questions.

    Regards,

    Harish

  • Thank you very much, and thank you Harish specifically for this detailed response I haven't found anywhere else. This is very interesting.

    But I still have a problem. As written above, your sample is working but not mine. I found the difference (by projects export / compare): my serial input port 2 is configured for 4 channels ×32 bits inputs as I use symetrical signals.
    Switching to 2 channels solves the trouble. But of course I need to keep my design as required.

    Well, this fs upgrading is much less simple than expected. I have tried changing some parameters but for now it fails.
    At last, 48 kHz is not so bad… Upside down
    But well, I like to understand and this diving into the deepness of SigmaStudio teaches me a lot.

    About the XML generation process, I understand how it works, using the codec's configuring page.
    But I have a question: is the chip "offline"? This setting interface does'nt seem to interfere really with it. The 'get current settings from chip' returns always the same config whatever XML had been sent.
    Thus the 'write current setting to chip' looks like writting something somewhere. Config fault of mine? This behaviour is unclear.

    Regards,
    Nicolas

  • Well, searching through the Engineer zone, it seems that 192 kHz on 4 inputs remains troublesome.

     RE: eval-adau1467Z rev. B documentation 

     RE: ADAU1467 EVAL BOARD I2C CONNECTION 

    I decide to stay with 48 kHz, especially since I may use all 4 inputs and 8 outputs.
    At last, I know now how to configurate the codec.

    Thank you

  • Hello Nicolas,

    Reg the XML file generation,

    Yes, it's done offline. You don't need to connect/power the USBi. All you need is AD193x DLL (module) in Sigma studio and connect it to USBi module in the GUI and click link compile download to generate the files.

    If you want to access the codec from USBi in runtime, then it can also be done.

    But you have to connect the USBi I2C pins to Master control port J6, not slave control port J1. 

    The CODEC is connected to the master control port side of the DSP; pins are exposed in J6. You can just program the SigmaDSP with a project via J1 and remove the USBi from J1, and move the switch S2 to I2C mode, then connect the USBi to J6 and set the CODEC address to 0x8 in the USBi and access it.

    Below is an example of how to program SigmaDSP via port J1 and Codec via port J6 using two projects.

    Initially put the switch S2 at I2C mode.

    1) First project has 192KHz SigamDSP and serial port setup with secondary I2C pins enabled, connect the USBi to ADAU1467 module and load this project, once you link compile downloaded the project, remove the USBi from the Eval board without resetting the board, it often gets reset during the removal, but you can gently remove it. Don't disconnect the USB cable from the USBi and remove, just remove the USBi from the board. you can watch the reset LED while removing to know if reset happened.

    2) Now, load the codec project into sigma studio and connect the USBi to port J6 and link compile download the project.

    Then do these three writes runtime and you will be able to listen to the audio.

    Just try this and let me know if it works.

    Codec_access_I2C_192KHz.dspproj192Khz_sigmaDSP_program.dspproj

    Regards,

    Harish

  • Yet another trouble.

    Running at 96 kHz is ok with 4 inputs.
    Precisely, ok when run from SigmaStudio/USBi.

    But it doesn't run in self boot mode. Just silent.

    What could be missing for self boot mode when codec startup setting in involved?
    Is some hardware setting to be changed?

    Here is my project, now with optional Bluetooth input.
    Base 96k ok + LT.dspproj

    <?xml version="1.0" standalone="no"?>
    <ROM IC="AD193x" IC_Address="8" Address_byte_length="1">
      <dateTime>2018-01-24T15:53:18.9331122Z</dateTime>
      <version>3.16.4.1751</version>
      <page modetype="Mode 0">
        <action instr="writeXbytes" len="2" addr="4"  ParamName="IC 1.DacCtrl2Register" DspName="IC 1">01</action>                   <!-- Mute global -->
    
        <action instr="writeXbytes" len="2" addr="0"  ParamName="IC 1.HWConfiguration.PllCtrl0Register" DspName="IC 1">80</action>
        <action instr="writeXbytes" len="2" addr="1"  ParamName="IC 1.HWConfiguration.PllCtrl1Register" DspName="IC 1">00</action>
    
        <action instr="writeXbytes" len="2" addr="2"  ParamName="IC 1.HWConfiguration.DacCtrl0Register" DspName="IC 1">02</action>   <!-- 0 = 48k, 2 = 96k, 4 = 192k -->
        <action instr="writeXbytes" len="2" addr="3"  ParamName="IC 1.HWConfiguration.DacCtrl1Register" DspName="IC 1">00</action>
    <!-- <action instr="writeXbytes" len="2" addr="4" ParamName="IC 1.HWConfiguration.DacCtrl2Register" DspName="IC 1">01</action> inutile : redondant -->
        <action instr="writeXbytes" len="2" addr="5"  ParamName="IC 1.HWConfiguration.DacMutesRegister" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="6"  ParamName="IC 1.HWConfiguration.DacVolumeRegistes0" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="7"  ParamName="IC 1.HWConfiguration.DacVolumeRegistes1" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="8"  ParamName="IC 1.HWConfiguration.DacVolumeRegistes2" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="9"  ParamName="IC 1.HWConfiguration.DacVolumeRegistes3" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="10" ParamName="IC 1.HWConfiguration.DacVolumeRegistes4" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="11" ParamName="IC 1.HWConfiguration.DacVolumeRegistes5" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="12" ParamName="IC 1.HWConfiguration.DacVolumeRegistes6" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="13" ParamName="IC 1.HWConfiguration.DacVolumeRegistes7" DspName="IC 1">00</action>
    
        <action instr="writeXbytes" len="2" addr="14" ParamName="IC 1.HWConfiguration.AdcCtrl0Register" DspName="IC 1">40</action>   <!-- 00 = 48k, 40 = 96k, 80 = 192k -->
        <action instr="writeXbytes" len="2" addr="15" ParamName="IC 1.HWConfiguration.AdcCtrl1Register" DspName="IC 1">00</action>
        <action instr="writeXbytes" len="2" addr="16" ParamName="IC 1.HWConfiguration.AdcCtrl2Register" DspName="IC 1">00</action>
    
        <action instr="writeXbytes" len="2" addr="4"  ParamName="IC 1.HWConfiguration.DacCtrl2Register" DspName="IC 1">00</action>    <!-- Unmute global -->
      </page>
    </ROM>

    Thank you,
    Nicolas

Before You Switch


Switching languages will make ADI Explorer unavailable. Resume your session by switching back to English and reopening ADI Explorer.