This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LMK04832-SP: Can this device operate with standard 4-wire SPI?

Part Number: LMK04832-SP

Hi,

Traditionally SPI is a 4-wire interface and my controller has sclk (output), cs* (output), mosi (output), and miso (input).

The datasheet (SNAS698B – MAY 2020 – REVISED DECEMBER 2020) is a bit unclear/confusing with respect to 4-wire SPI.

  1. The LMK04832-SP only lists sclk (output), cs* (output), sdio (bidir) so only 2 of 4 signals map. Perhaps there is a dual-function pin elsewhere?
  2. Page 12 suggests the possibility of a 4-wire readback implying a 4-wire SPI interface capability
  3. Page 43 states, "To use a 4-wire SPI mode, selecting SPI Read back in one of the output MUX settings. For example CLKin0_SEL_MUX or RESET_MUX. It is possible to have 3-wire and 4-wire readback at the same time.
    1. Which "one of the output MUX settings"?
    2. I assume CLKin0_SEL_MUX actually means CLKin0_SEL0_MUX where the field value of register 0x148 with a value of 0x6 shows SPI Readback
  4. Page 43 also shows register 0x0000 has a "Disable 3-wire SPI mode" control bit implying that something like 4-wire SPI would replace this
  5. A number of "MUX" registers allow a selection of SPI Readback
    1. Registers 0x148, 0x149, 0x14A, ox15F, and 0x16E
    2. Setting the selection in any one of these registers for SPI Readback mutually excludes the other options (i.e. mux) so choose wisely
    3. Given that, probably easiest to choose RESET_MUX
  6. Register 149 defaults to open drain output for SDIO_RDBK_TYPE
    1. Should this be set for push/pull in 4-wire SPI mode?
    2. Should the other pin also be set tp push/pull?

Best guess at the moment is as follows:

  1. Somehow the chip gets reset
  2. Somehow a 4-wire host writes the default 3-wire LMK04832-SP SPI interface to configure it to use/be a 4-wire SPI interface
  3. Registers
    1. 0x000[7]=0, normal operation AND 0x000[4]=1, 3 Wire Mode disabled
    2. 0x149[1]=0, SDIO_RDBK_TYPE is push/pull (or perhaps simply matches the RESET/GPO output type)
    3. 0x14A[5:3]=0x6, SPI Readback AND 0x14A[2:0]=0x3 RESET_TYPE is push/pull (or perhaps simply matches the SDIO_RDBK_TYPE output)

That's the research, now some more questions:

  1. How does the LMK04832-SP get reset if we're using RESET/GPO as a SPI data pin?
  2. How does one configure the device using it's 3-wire SPI interface to become a 4-wire SPI interface when the controller is not a 3-wire interface?
  3. When in 4-wire SPI mode using one of the *mux pins configured for SPI readback, is it this *mux pin that will connect to the host's MISO (master-in, slave-out) pin?
    1. i.e. from above example RESET/GPO would connect to host's MISO
  4. When in 4-wire SPI mode does pin 20 (SDIO) connect to the host's MOSI (master-out, Slave-in) pin thus becoming the data input for the LMK04832-SP?

Thanks kindly,

Dan

  • Hi Dan,

    Datasheet comments:

    1. Any one of the GPIOs (PLL1_LD, PLL2_LD, RESET, CLKin_SEL0, CLKin_SEL1) can be reconfigured for use as SPI SDO.
    2. See above
    3. See above. Note that the corresponding _TYPE register (PLL1_LD_TYPE, PLL2_LD_TYPE, RESET_TYPE, CLKin_SEL0_TYPE, CLKin_SEL1_TYPE) must be set to an output type such as push/pull or open-collector.
    4. 3-wire and 4-wire SPI can run simultaneously, as noted in (3). SPI_3WIRE_DIS=1 disables the SDO functionality on the SDIO pin, ensuring that the SDIO pin always remains exclusively an input.
    5. Okay
    6. SDIO_RDBK_TYPE only controls the type of output buffer used by the SDIO pin in 3-wire SPI. For 4-wire SPI, use the corresponding _TYPE register as indicated in (3) above.

    Comments on "best guess":

    • We recommend leaving SDIO_RDBK_TYPE=1, as open drain, to make sure that the SDIO pin is never actively driven or conflicted in case 3-wire mode is somehow enabled by accident. That said, once SPI_3WIRE_DIS=1, SDIO_RDBK_TYPE state is don't care since SDIO is made incapable of readback by SPI_3WIRE_DIS=1.
    • 0x14A = 0x33 ([5:3] = 0x6, [2:0] = 0x3) would correctly set RESET pin as GPO using SPI readback.

    More questions:

    1. LMK04832-SP will perform a POR at power-up, and can also be reset by setting the RESET bit in R0 = 1. The RESET bit in R0 behaves the same as a high input on the RESET pin. I believe the recommended programming sequence in the datasheet suggests toggling the RESET bit before any other programming as well.
    2. Just write to the 3-wire SPI interface as though it is CS*/SCK/SDI exclusively, until you have made the modifications to disable 3-wire SPI and to set RESET pin as SDO. Unless you try to perform a readback transaction with SPI_3WIRE_DIS=0, the SDIO line will always behave as an input, so just don't read back until configuration as a 4-wire interface is complete. Once RESET pin is configured as SDO, now it's a 4-wire interface.
    3. Correct
    4. Correct

    Regards,

    Derek Payne

  • Thanks Derek for the very timely answers!

    They resolved pretty much everything I originally asked.

    I am still unclear during power-up how the device actually gets reset. The datasheet simply doesn’t appear to describe this that I’ve seen.

    We would want to be sure that the device powers up and resets correctly to the published defaults without need of writing the reset register.

    Are there any available details relating to power-up and reset operations at the hardware level?

    A new related question comes from pg 12 of the datasheet where it states “4-wire mode read back has same timing as SDIO pin”.

    I find this a tiny bit suspicious as some of the mux selectable outputs for 4-wire SPI are on different edges of the package than SDIO.

    I can see how the statement can be accurate under a couple of conditions:

    1. The clock-to-out delays on all of those possible pins are the same
    2. The tDV value of 120ns simply envelopes all of the possible pins

    Just wanted to confirm.

    Is there any minimum value available for tDV?

    Thanks,

    Dan

  • Dan,

    I'm confirming internally the behavior of POR, RESET bit, and RESET pin. In general, when the device powers up, there is a period of time at startup where all the LDOs are powering up and stabilizing across the device. We have an on-board ~10MHz oscillator on the digital clock which counts out some number of cycles for the system to load all the registers with the default values programmed in metal, and as far as I know the only difference between POR and bit/pin reset is the addition of some time or some other equivalent mechanism to allow the LDOs to settle at startup. Exactly how this works, and how long it takes, as the timings are not captured in the datasheet - hence why I am confirming internally. If my suspicions are correct, you don't need to do anything except power up the device to ensure that the default values are properly loaded.

    SDO being at different edges of the package might introduce 1-2ns timing difference. We've set the tDV max value at 120ns, and since SCK is limited to 2MHz (500ns period, 250ns from falling edge to rising edge) the readback value will always be stable on the next SCK rising edge. I can't say for certain, but I suspect the 120ns number is sandbagged as well, to help guarantee behavior across PVT for even the most exceptional of cases.

    In the absence of a printed minimum value, I will appeal to causality: the falling edge of SCK triggers the data to update for readback, so I suggest the lower limit is 0ns.

    Regards,

    Derek Payne

  • Thanks again Derek,

    I’ll let you chase the reset thing a bit but it seems power-up and forget it.

    As for the minimum clock-to-out I would have assumed 0 as well in the absence of a value even thought we know it is always >0.

    The challenge here is that it can make meeting hold time difficult (particularly when SI inegtrity tools produce a legitimate negative trace delay based on an IBIS model).

    Someone wishes to connect the RESET/GPO to have available for a hardware driven reset so we will use pin 48

    RESET by naming convention appears to be active high and can be confirmed in Table 8-46 for register 0x14A .

    RESET_TYPE can be configured to include an internal pulldown (default) or pullup and no approximate value for these pulls is available.

    I would typically pull the an active-high reset input low externally with a fairly stiff value like 1K.

    I want to be sure this would not impact the normal device reset at power up though it seems unlikely since the default is pulled down anyhow.

     

    Another new observation:

    Sections 6.1 and 6.3 define VDD and VDD_A.

    The electrical characteristics tables in section 6.5 all report their values are for VDD=VDD_A=3.3V

    The actual parametric data in the tables is all using a generic value of Vcc.

    The device pins use Vcc1-Vcc12  with a descriptor following such as Vcc5_DIG.

    I assume all 12 Vcc pins use 3.3V, for example on pg 11 Digital Outputs, VOHmin is Vcc-0.4 meaning VDD-0.4.

    Can any of the 12 Vcc pins be left disconnected if an entire related group (see Figure 5-1) would be left unused?

    VDD_A is defined as the “core” voltage yet none of the 12 Vcc* pin descriptions mentions a core voltage.

    I’m assuming the core voltage comes from Vcc3_SYSREF based on Figure 5-1 – is that correct?


    Regards,
    Dan

  • Hi Dan,

    I determined that the reset behavior is identical for register, pin, and POR resets (though, interestingly, after writing RESET=1, the device will remain in the RESET state until the start of the next SPI transaction). That said, there should be no impact to POR if the reset pin sees noise at startup - the reset sequence will just start over. A stiff external pull-down value is not strictly required given the internal resistance, but remains a good idea.

    All VCC pins must be connected to 3.3V, even if something is unused. The VDD_A and "Core supply" language may be a poorly-explained attempt to distinguish between VCC5_DIG (all digital I/O powered from this supply) and the other VCC pins. (In which case why wasn't VDD_A referred to as VCC5_DIG? Probably because we called it that in another datasheet and it got copied...) Treat them as the same supply for all intents and purposes, since I am certain we never individually varied any specific pin voltagess with respect to others as the artificial distinction here implies.

    There are register settings which can powerdown large sections of the LMK04832-SP, and this is the recommended method for reducing power consumption. Many unused rails can approach 0mA consumption after the appropriate register settings are specified.

    For our parametric data, we ensured that the supply voltage at the device pins was 3.3V as closely as possible, though some supplies draw slightly more than others so there can be some ~10mV difference at test time. All parameters have also been characterized to 3.3V ±5% on all supplies.

    Regards,

    Derek Payne

  • Thanks for all your assistance Derek.