Post Go back to editing

ADAU1467 how to configure ADCs and DACs via SPI and I2C?

Category: Hardware
Product Number: ADAU1467

Hello support team.

I'm using the ADAU1467 DSP and I need to configure two AD1933 DACs and three ADAU1979 ADCs.

The schematic diagram of the DSP connection with the two DACs and the three ADCs is shown in the figure below.

The two DACs are connected to the SPI master port of the ADAU1467, I am using the MP6 and MP7 pins as chip selects.

The three ADCs are connected to the ADAU1467 master I2C2 port, with different addresses:
ADC1_ADDR = 0x22 WR, 0x23 RD;
ADC2_ADDR = 0x62 WR, 0x63 RD;
ADC3_ADDR = 0xA2 WR, 0xA3 RD.

I saw that the DAC ADAU1979 is not present in the list of devices compatible with the Sigma Studio. Therefore, I think it is not possible to use the capture window method to create the XML configuration file.

First question: How can I create the configuration file for ADAU1979?

Second question: The configuration of the ADCs and DACs will be done one at a time, can I use both SPI and I2C interfaces for this purpose, activating the SECONDARY_I2C_ENBL bit in register 0xF5F0?

If I'm not abusing it, could you provide me with an example project containing these initializations.

Best Regards.

Parents
  • Hello Takahashi,

    I saw that the DAC ADAU1979 is not present in the list of devices compatible with the Sigma Studio

    You can find ADAU1977's DLL in the sigma studio, so you can use the same for ADAU1979, Registers are the same. few additional registers will be there in one of the chips but that doesn't affect the existing registers between these two chips. So, you can use it without a problem.

    First question: How can I create the configuration file for ADAU1979?

    You can use ADAU1977 in SS and export the xml file using capture window and use it in your schematic.

    The configuration of the ADCs and DACs will be done one at a time, can I use both SPI and I2C interfaces for this purpose, activating the SECONDARY_I2C_ENBL bit in register 0xF5F0?

    I edited a little. I will explain to you in a better way with a detailed reply.

    The attached project allows both protocols to be configured but not at a same time. I often use this project to self-boot from an EEPROM (SPI) and config the CODEC (I2C) in our eval board.

    In self-booting phase, this register is disabled (SPI pins) and using this SPI pins the self-boot will happen. Once the entire program is loaded in the DSP RAM and DSP starts executing the program, we will write '1' to the register and enable the secondary I2C port it in the schematic which is placed in the left top corner of the schematic page, the compiler will run it first and then go for other blocks. Now the sec I2C port is enabled and triggering the master control port will send the I2C commands to the CODEC and the codec will be programmed.

    If you write this attached project to the EEPROM and self-boot it, it will self-boot from an EEPROM by using SPI and once the program starts running it will program the codec by using I2C.

    SigmaDSP Programming CODEC via I2C to 192 kHz.zip

    Have a look at boot time master control port here which sends SPI/I2C commands prior to the audio processing. This is typically used to program the converters. Hope this will give you an idea.

    Regards,

    Harish

Reply
  • Hello Takahashi,

    I saw that the DAC ADAU1979 is not present in the list of devices compatible with the Sigma Studio

    You can find ADAU1977's DLL in the sigma studio, so you can use the same for ADAU1979, Registers are the same. few additional registers will be there in one of the chips but that doesn't affect the existing registers between these two chips. So, you can use it without a problem.

    First question: How can I create the configuration file for ADAU1979?

    You can use ADAU1977 in SS and export the xml file using capture window and use it in your schematic.

    The configuration of the ADCs and DACs will be done one at a time, can I use both SPI and I2C interfaces for this purpose, activating the SECONDARY_I2C_ENBL bit in register 0xF5F0?

    I edited a little. I will explain to you in a better way with a detailed reply.

    The attached project allows both protocols to be configured but not at a same time. I often use this project to self-boot from an EEPROM (SPI) and config the CODEC (I2C) in our eval board.

    In self-booting phase, this register is disabled (SPI pins) and using this SPI pins the self-boot will happen. Once the entire program is loaded in the DSP RAM and DSP starts executing the program, we will write '1' to the register and enable the secondary I2C port it in the schematic which is placed in the left top corner of the schematic page, the compiler will run it first and then go for other blocks. Now the sec I2C port is enabled and triggering the master control port will send the I2C commands to the CODEC and the codec will be programmed.

    If you write this attached project to the EEPROM and self-boot it, it will self-boot from an EEPROM by using SPI and once the program starts running it will program the codec by using I2C.

    SigmaDSP Programming CODEC via I2C to 192 kHz.zip

    Have a look at boot time master control port here which sends SPI/I2C commands prior to the audio processing. This is typically used to program the converters. Hope this will give you an idea.

    Regards,

    Harish

Children
  • Thank you very much for your feedback.

    When you say that you cannot use both protocols at the same time, because the pins are multiplexed, another question arose for me.
    According to the ADAU1467 datasheet, see text highlighted in figure 1, when selecting SECONDARY_I2C_ENBL = 1, this causes the I2C_MASTER port to be on pins MP24 and MP25, leaving the MP2 and MP3 pins exclusive to the SPI_MASTER port.
    This way, it becomes possible to use both SPI_MASTER and I2C_MASTER ports as long as they are used one at a time.
    In figure 2 I want to know if this is how to configure the CODECs. I didn't find detailed documentation of the "Master Control Port IO Ext. Trigger" component. I noticed that this component has two pins:
    pin0: Trigger;
    pin1: In Progress.
    I thought that the pin1 signal would serve as a trigger to activate the next CODEC configurator.
    According to the scheme in figure 2, I am initializing DAC1 and DAC2 via SPI, using the same XML file for the AD1933 and then ADC1, ADC2 and ADC3 via I2C, with an XML file of the ADAU1979 settings.
    If the scheme is wrong, could you show me how to configure multiple CODECs?

    Best Regards.

    figure 1.

    figure 2.

  • Hello,

    I acknowledge your reply and will post my answer soon.

    Regards,

    Harish

  • Hello cTakahashi,

    For starting up several devices when you boot up it is best to use a different module that takes care of all this for you. 

    In the Master Control Port Startup Boot section, drag in how ever many devices you need to start up. It will automatically increment the order they will be executed in. The parameter labeled "Slave" on the front of the block is misleading. It is the order they will be executed. When you click on the blue box to setup the interface, that is where you select the slave address and if it is SPI then the slave select pin to use. 

    These will all execute once at startup and not use up any MIPS after that. 

    Regarding using both protocols at the same time. You can have the two types of protocols setup but only one of them can be used at any moment. Internally there is only one communications module that needs to be configured. So the software will configure it for SPI and that will use the pins for SPI. Then when it needs to use I2C the communications module will be reconfigured for I2C and then the I2C outputs of the module are redirected to the MP pins.

    Internally, there are SPI pins and I2C pins and on the 1452 the actual pins are switched to be SPI or I2C. What we did in the Sigma350 parts is to break them both out and make the I2C pins available as an option on the two MP pins so someone can setup hardware to do both standards. 

    I hope this helps,

    Dave T

  • Hi Dave, thank you very much for the explanation.

    I changed my project to use the "Startup Boot" "Master Control Port IO".

    I want to answer some more questions that arose while I was doing the project.

    Question 1:
    In the XML files I noticed the parameters: IC_Address, ParamName and DspName that differentiate the devices, see figure 1.
    I tried using the same XML files for the same devices, when linking the project it seems that there was no error.
    I still don't have the target to test. Can you tell me if this is right?

    Question 2:
    In the example project I received from Harishgowtham he used a "DC Input Entry" together with "Register Write" to change the SECONDARY_I2C_ENBL to 1.
    Can I do this by making changes to the "Hardware Configuration" of the ADAU1467 in the MULTIPORTUSE1 tab, as shown in figure 2?

    Question 3:
    To be able to use MP6 and MP7 as AD1933 select SPI chip pins, I made the changes in the "MULTIPURPOSE" tab as shown in figure 3. Can you tell me if this is correct?

    MP6 MODE:
    Slave select channel selection: Slave select channel 6;
    Debounce time setting: 0.3 ms debounce;
    Mode Setting for MPx: Slave select for the master control port;
    Enable MP function of the pin: MP function of the pin is selected.

    MP6 WRITE:
    multiPurpose Write Register: MP pin output on (green color)

    MP7 MODE:
    Slave select channel selection: Slave select channel 7;
    Debounce time setting: 0.3 ms debounce;
    Mode Setting for MPx: Slave select for the master control port;
    Enable MP function of the pin: MP function of the pin is selected.

    MP7 WRITE:
    multiPurpose Write Register: MP pin output on (green color)

    Question 4:
    Can you tell me if I'm still missing something?

    Best Regard.

    figure 1.

    figure 2.

    figure 3.

  • Hello cTakahashi,

    In the XML files I noticed the parameters: IC_Address, ParamName and DspName that differentiate the devices, see figure 1.
    I tried using the same XML files for the same devices, when linking the project it seems that there was no error.
    I still don't have the target to test. Can you tell me if this is right?

    You can use the same generated XML file for all your slave devices but make sure that the device address is changed according to that slave. Just editing the 'Device address' in decimal and saving it as a different file would be fine.

    Can I do this by making changes to the "Hardware Configuration" of the ADAU1467 in the MULTIPORTUSE1 tab, as shown in figure 2?

    Yes, you can do that if your project needs that. The reason it was configured with DC cell is because it has to execute first as soon as the program starts running. AS I mentioned, in that project, the DC and reg write block will get compiled first then other blocks will be compiled. You can also write that register from a GPIO or from SS if you want to.

    To be able to use MP6 and MP7 as AD1933 select SPI chip pins, I made the changes in the "MULTIPURPOSE" tab as shown in figure 3. Can you tell me if this is correct?

     Note that, you are not selecting slave select channel 6 and 7 because you are using MP6 and MP7. The SPI config window has to be configured correctly.

    Ex, if you choose MP6 as a slave select, the below setting will also work.

    MP6 MODE:
    Slave select channel selection: Slave select channel 1;
    Debounce time setting: 0.3 ms debounce;
    Mode Setting for MPx: Slave select for the master control port;
    Enable MP function of the pin: MP function of the pin is selected.

    You have to set the config window like this.

    If MP7 is also used,

    MP7 MODE:
    Slave select channel selection: Slave select channel 0;
    Debounce time setting: 0.3 ms debounce;
    Mode Setting for MPx: Slave select for the master control port;
    Enable MP function of the pin: MP function of the pin is selected.

    Mapping between the GPIO register and this SPI config window has to match, please refer below table.

    Additionally note that, no register configuration is needed when you are using the main latch which is SS_M pin, which is used for self-boot operation, self-boot can only be done using that main latch.

    Hope this answers your question.

    Regards,

    Harish

  • Thank you very much Harishgowtham and Dave for your advice.

    Best Regards.