This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

SPIS select pin

Hello Nordic,

I'm working with NRF52840 (with SDK 16 and softdevice s140 7.0.1) in my project. I need to work with another chip through SPI. This chip is the master and NRF should be the slave.

The following picture is the required protocol flow to start the conversation and then send and receive data.

As you can see, the SS pin from SPI master doesn't change after fetch data or command data which is a problem, because as I understood from NRF52840 documents, the only way to get a NRF_DRV_SPIS_XFER_DONE event from SPIS and change TX and RX buffers is when select-pin goes high, which can't happen here due to this design.

Is there any way to perform SPIS without select pin and perform events based on the amount of data received or sent? or the absence of the clock signal?

Or more generally, is there anyway to change the SPIS functionality in a way that is suitable with this design? 

Thank you.

Parents
  • Is there any cases where the SPI master will send something other than "Fetch" in the beginning and "status" in the end?

    If not, does it matter that the data is sent before the fetch is complete? What happens if the nRF Starts pushing data at the same time as it receives the "fetch"?

    Best regards,

    Edvin

  • Is there any cases where the SPI master will send something other than "Fetch" in the beginning and "status" in the end

    There are, but for now we only need this part.

    does it matter that the data is sent before the fetch is complete?

    I don't think it would be possible, since there is a time delay between fetch and command in the protocol.

    Are you suggesting to put command on the output and when SS goes high read fetch and status together?

  • You can of course try to add 0x00's or 0xff's as padding (the same amount of bytes that the "fetch" and "status" messages are.

    Unfortunately, there are no events that you can use in between the EVENTS_END, which is the event that triggers the NRF_DRV_SPIS_XFER_DONE event:

    spis_irq_handler() -> spis_state_change(p_spis, p_cb, SPIS_XFER_COMPLETED); -> spis_state_entry_action_execute() -> event.evt_type  = NRFX_SPIS_XFER_DONE; -> NRF_DRV_SPIS_XFER_DONE -> spis_event_handler().

Reply
  • You can of course try to add 0x00's or 0xff's as padding (the same amount of bytes that the "fetch" and "status" messages are.

    Unfortunately, there are no events that you can use in between the EVENTS_END, which is the event that triggers the NRF_DRV_SPIS_XFER_DONE event:

    spis_irq_handler() -> spis_state_change(p_spis, p_cb, SPIS_XFER_COMPLETED); -> spis_state_entry_action_execute() -> event.evt_type  = NRFX_SPIS_XFER_DONE; -> NRF_DRV_SPIS_XFER_DONE -> spis_event_handler().

Children
No Data
Related