Post Go back to editing

Silicon Error - SPI SCLK_M on wrong pin with SECONDARY_I2C_ENBL

Category: Hardware
Product Number: ADAU1463

The Secondary I2C Master Register SECONDARY_I2C_ENBL setting moves SPI master control port signal SCLK_M from pin 34 (MP2) to pin 30 (MP24). This setting should only move the I2C signals to SCL2_M and SDA2_M, but it also moves the SPI SCLK signal in error. All other SPI master control port signals - SS_M MOSI_M MISO_M - remain on the correct pins.

Although the data sheet says, "Note that only one of the two protocols can be used at a time," there is no expectation that SCLK_M will move, and no documentation of this.

My test hardware is a custom board that brings pins 30 through 35 to a header, along with the /WP signal of the SPI EEPROM and the /RESET signal for the SigmaDSP. This allows an 8-channel logic analyzer to view all relevant signals simultaneously. My design depends upon the I2C Master 2 pins functioning, because all DAC, ADC, and A2B chips are attached there. The SELFBOOT EEPROM is on SPI Master.

STEPS TO REPRODUCE SILICON ERROR:

1. Create a project in SigmaStudio+ 2.4.0 - preferably one which uses the I2C Master 2 pins. Use Link-Compile-Download to confirm that it functions when running on the hardware platform.

2. Use "Write Latest Compilation Through DSP" and note that the logic analyzer shows pins 30, 32, 33, and 35 have activity. The SPI SELFBOOT EEPROM write fails, since the chip does not see any SCLK_M activity from pin 34.

3. Without any further Link Compile or Download activity (which would alter the firmware), use SigmaStudio+ ADAU1463 Settings to toggle the SECONDARY I2C Master Enable at the bottom of the MULTIPURPOSE 1 page. Now use "Write Latest Compilation Through DSP" again and note that the logic analyzer shows pins 32, 33, 34, and 35 have activity as documented and as expected for proper operation.

4. You should be able to repeat the "Write Latest Compilation Through DSP" functions as many times as needed, while toggling the SECONDARY_I2C_ENBL setting, to witness the SPI master control port SCLK_M signal move between pins 34 (MP2) and 30 (MP24). It should not do this according to the data sheet documentation.

While it's theoretically possible that this is not a silicon error, it would require the "Write Latest Compilation Through DSP" firmware to be bit-banging the SPI master control port pins direcly, without the hardware peripheral engaged. I suspect that such bit-banging is not actually possible with SigmaDSP. Instead, I'm sure that the hardware SPI master control port peripheral is being used, and that the silicon routes the SPI SCLK_M signal to the wrong pin when I2C master 2 is selected.

Bottom line: There is no way to use the SPI master control port in firmware that has the I2C Master 2 port enabled. The only time the SPI master control port works is during SELFBOOT, before SECONDARY_I2C_ENBL gets set.

  • To phrase this silicon error in conceptual terms, rather than technical details...

    The whole purpose of the ADAU146x family of larger chip packages is to add more pins and enable more function. e.g. The SDATAIOx pins allow communications with CODEC, ADC and DAC chips using 2 or 4 bits of data instead of just 1. Specifically, the ADAU145x family shares just 4 pins for both I2C and SPI, and thus circuit designs cannot mix busses. The ADAU146x adds 2 more pins so that I2C can be split off, leaving the original pins for SPI. For backward compatibility, the default settings maintain both I2C and SPI on the original 4 pins, but SECONDARY_I2C_ENBL takes advantage of the 2 added pins to isolate I2C traffic from SPI traffic.

    The silicon error is that SECONDARD_I2C_ENBL does not effectively spilt the two protocols, because SCLK_M/SCL_M stay tied together when moving from MP2 to MP24. The only successful split is that SDA_M/MISO_M does indeed move SDA_M to SDA2_M while leaving MISO_M on its on. That much seems to work. In contrast, SCLK_M/SCL_M are never split, even when the setting moves to SCL2_M, because SCLK_M follows it.

  • Sorry for the delay. I am still looking at this.

    Ken

  • SoundConsulting,

    It's been quite a while since I've looked at this as I primarily worked on the part when it was released about 10 years ago. I've read the question a few times, and I'm still a little confused. If I understand correctly, your paradox is that that SECONDARY_I2C_ENBL must be disabled in order to write to the SPI flash, but you want it enabled in your application. if this is the case, you can write a 0x1 to the SECONDARY_I2C_ENBL register graphically as follows in SigmaStudio:

    or like this in SigmaStudio+:

                   

    Setting SECONDARY_I2C_ENBL to 0x01 does cause SCL_M to move to SCL2_M replacing MP24 and SDA_M to move to SDA2_M replacing MP25. I think we both agree that works.

    To boot from the SPI port and use the secondary I2C pins, clear the register in the program before compiling, then set it graphically as above. Regarding how to use the SPI interface after boot, I believe that, if you clear the SECONDARY_I2C_ENBL, SCLK_M goes back to it's original function provided that port had the SPI function initially. If you boot in I2C mode then SPI is not available at all. Unfortunately, there is not easy way to graphically switch back to SPI mode without an external microcontroller. 

    Please let me know if I've understood your question and answered it correctly.

    Best regards,

    Ken


     

  • Setting SECONDARY_I2C_ENBL to 0x01 does cause SCL_M to move to SCL2_M replacing MP24 and SDA_M to move to SDA2_M replacing MP25. I think we both agree that works.

    It works for I2C, but this is broken for SPI. As I mentioned, MISO_M stays on the SPI pins when SDA_M moves to SDA2_M, but the silicon error is that SCLK_M does not stay on the SPI pin but instead moves with SCL_M so that both SCLK and SCL end up on SCL2_M. Thus, the SPI bus is non-functional when I2C2 is enabled.

    To be clear, SCLK_M is the SPI clock, and it should remain on the same pin regardless of the SECONDARY_I2C_ENBL setting. SCL_M is the I2C clock, and it is supposed to move (and does) when the setting changes.

    It seems that you misunderstood my question, because I am reporting a silicon error. I have already found a workaround in SigmaStudio, but the crucial fact is that SPI is unusable when the Secondary I2C pins are enabled.

  • Note that my workaround is only viable on systems that do not use the SPI bus after boot. The silicon error will have to be repaired for SPI to retain all signals on the appropriate pins when the Secondary I2C is enabled.

  • I understand now. I'm glad you found a workaround. Yes, you are correct. This behavior is because, internally, there is only one clock line in the M* port hardware block. The secondary I2C concept is, admittedly, a bit of a hack and definitely an architectural afterthought. The 146x parts are derivatives of the 145x parts with some minor extensions to improve I/O. Most of these just bring internal signals out to new pins with minor new control logic. To do this "properly" would have meant ripping up the M* port block, which was outside the scope of the project at the time. Sorry for the inconvenience.

    Ken

    *We avoid using the name used in the original data sheet now.

  • Thank you for explaining and confirming.

    I was confused because MISO_M is successfully split from SDA_M when the latter moves to SDA2_M, so I expected the same for the other pair (SCLK_M and SCL_M).

    I suggest that the data sheet should be updated in several places to document the actual behavior, and the pin name should be as follows: SCL2_M/SCLK2_M/MP24 - as it stands the pin labeling is inaccurate.

    Besides properly naming the pin, there should be some recognition in the data sheet that the schematic design for all boards based on the ADAU146x will not be able to use SPI when SECONDARY_I2C_ENBL is set, unless the SPI clock line is wired to the alternate pin. This is particularly of note because the SELFBOOT function uses SCLK_M on a different pin than the one that must be used after boot. If some circuit designer were to try to use SPI and I2C - even just one at a time - then all SPI devices beyond the SELFBOOT memory would have to be wired on a different clock pin.

    There is a note in the data sheet explaining that both SPI and I2C cannot be used at the same time, but this should be reworded to clarify that use of the Secondary I2C basically makes the primary SPI port unusable.

  • By the way, I based my custom design on the ADAU1463 based on recommendations from this EngineerZone after I asked about connecting both SPI and I2C in the same system. There was no warning that it would not actually work exactly as documented.

  • If I understand everything correctly, the stock firmware used by SigmaStudio and SigmaStudio+ should always set SECONDARY_I2C_ENBL to 0, at least for SPI-connected EEPROM, so that Write and Check of the SELFBOOT memory will succeed.

    As it stands, I must manually toggle that setting when I Write the latest compiled firmware through the DSP, and then I must remember to restore it to enable the Secondary I2C before using SigmaStudio for further development.

Before You Switch


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