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

SPI clock stops after tx even if requested for rx

Iam using softdivice 110 and sdk 10.0.0, iam using spi driver for interfacing with spi slave device(flash memory device). I need to send command and then receive the data present in flash, iam using function nrf_drv_spi_transfer() to transfer the data. The problem is when nrf_drv_spi_transfer function with 3 bytes to send and 2 bytes to receive the clock cycles are stops after sending 3 bytes. kindly help me out

Parents
  • I don't know how many times this gets discussed. SPI is a synchronous transfer protocol (it helps to read about the protocols you're using) so if you ask for 3 bytes to send and 2 to receive the driver will transfer a total of 3 bytes, because the two receives are at the same time as the first two of the sends.

    If you want 3 bytes sent THEN two received, you need to give it 3 for send and 5 for receive, and ignore the first 3 bytes.

Reply
  • I don't know how many times this gets discussed. SPI is a synchronous transfer protocol (it helps to read about the protocols you're using) so if you ask for 3 bytes to send and 2 to receive the driver will transfer a total of 3 bytes, because the two receives are at the same time as the first two of the sends.

    If you want 3 bytes sent THEN two received, you need to give it 3 for send and 5 for receive, and ignore the first 3 bytes.

Children
Related