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

Receive 1 byte from SPI

I want to receive only 1 byte (Master in Slave out) without sending any bytes using using SPI. However when I monitor the SPI clock it produces 16 clock pulses. Although my application works, I would prefer it produces only 8 clock pulses.

When I use the same procedure to receive 9 bytes it correctly produces 72 clock pulses. In this example spi_rx_num is 1.

err_code = nrf_drv_spi_transfer(&m_spi, spi_tx_data, 0, spi_rx_data, spi_rx_num);

My problem is the ADS2192R which requires approx 10us between each SPI transfer when issuing a read register commend. I send the 2 bytes of the commend correctly to read 1 register, but I cannot perform a read of a single byte.

Parents
  • Thank you for your rapid response. I tried slowing the clock, but this still did not give reliable results. I have therefore returned to my original solution to send byte by byte and insert a gap (conviently about correct given delay to process the SPI event). As I only use this during initialisation it is not an issue. This means I can use maximum speed for SPI and a single call to retrieve the 9 bytes of the data sample.

Reply
  • Thank you for your rapid response. I tried slowing the clock, but this still did not give reliable results. I have therefore returned to my original solution to send byte by byte and insert a gap (conviently about correct given delay to process the SPI event). As I only use this during initialisation it is not an issue. This means I can use maximum speed for SPI and a single call to retrieve the 9 bytes of the data sample.

Children
No Data
Related