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.
- 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?
- Page 12 suggests the possibility of a 4-wire readback implying a 4-wire SPI interface capability
- 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.
- Which "one of the output MUX settings"?
- 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
- 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
- A number of "MUX" registers allow a selection of SPI Readback
- Registers 0x148, 0x149, 0x14A, ox15F, and 0x16E
- Setting the selection in any one of these registers for SPI Readback mutually excludes the other options (i.e. mux) so choose wisely
- Given that, probably easiest to choose RESET_MUX
- Register 149 defaults to open drain output for SDIO_RDBK_TYPE
- Should this be set for push/pull in 4-wire SPI mode?
- Should the other pin also be set tp push/pull?
Best guess at the moment is as follows:
- Somehow the chip gets reset
- 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
- Registers
- 0x000[7]=0, normal operation AND 0x000[4]=1, 3 Wire Mode disabled
- 0x149[1]=0, SDIO_RDBK_TYPE is push/pull (or perhaps simply matches the RESET/GPO output type)
- 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:
- How does the LMK04832-SP get reset if we're using RESET/GPO as a SPI data pin?
- 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?
- 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?
- i.e. from above example RESET/GPO would connect to host's MISO
- 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