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

nrf_drv_spi_transfer and the status byte of the slave

Hi everyone,

I'm a little bit helpless at the moment, I'm using the function "nrf_drv_spi_transfer" for the SPI communication with a power management chip. This chip is sending his status byte while I'm sending the instruction/address byte.

So basically I do this:
APP_ERROR_CHECK(nrf_drv_spi_transfer(&eh_spi, 0x55, 1, &status, 1));

Now, I expect the status byte in my status variable. With an osciloscope, I saw that there are 16 clocks. I expected them to be 8.

When I do this:
APP_ERROR_CHECK(nrf_drv_spi_transfer(&eh_spi, &test, 1, NULL, 0));

it send 8 clocks but where can I read the status byte now?

Basically for reading from the EEPROM of my chip, I need to send one instruction/address byte (receive the status byte), wait 1ms and then receive the EEPROM byte. How can I do that with this SPI HAL?

Best regards,

Manuel

Parents Reply Children
Related