0
votes

I am using a nRF52832 chip attached to a DW1000 module. The issue is when requesting data from the DW1000, the first byte is missing. The chip is supposed to send 0xDECA0130 but instead I receive 0xCA0130FF. When I make the receive buffer larger, the missing 0xDE shows up (the transmission starts with the lowest byte). My question is, how and why this is happening.

Configuration

The SPI configuration was made according to the datasheet of the DW1000, using the nRF SPI driver. It includes

  • SPI Default Frequency set to 1MHz
  • SPI Chip Select Pin configured as active LOW
  • using SPI Mode 0
  • MSB first transmission

Before starting the communication, the DW1000 is reset by pulling its reset pin low and kept low for a long enough duration before releasing it. After resetting, the master waits some time to let the module boot up. After that, the first thing is reading said value as a 32 bit register value.

nRF Settings

The nRF settings include

  • SPI and SPI0 enabled
  • SPI0 easyDMA disabled
  • reading the value includes nrf_drv_spi_transfer with said configuration and a buffer lenght of 4 bytes

Steps taken

I already tried the following things, without any solving of the problem:

  • Changing the SPI Frequency
  • Changing the SPI Mode*
  • Increased waiting time after reset
  • Increased waiting time between transmissions
  • Changing MISO Pull-Up Configuration*
  • Manual Chip Select (including Pull-Up Configuration*)

The steps indicated with (*) I'm aware of that they should not resolve the problem.

Unfortunately it is an embedded device, so I cannot access the CLK and MISO pins to hook up to an oscilloscope.

I appreciate any input on the matter.

1

1 Answers

0
votes

So apparently the problem lies in the way an SPI slave responds to a specific request. Since SPI is a synchronous protocol, the slave must transmit data from the first clock cycle onwards. Since it doesn't know what to send before at least the first byte is transmitted (if configured that way), it must send something, so the master should ignore (at least) that first character being transmitted. If the length of the read request is known, the transmission must thus be one byte longer than the requested data itself.