Hi,
I’ve been testing 2 DWM1001-DEV to measure the distance between them.
I did that successfully using API via UART, sending 0x0C and 0x00 and then reading the answer.
Now I’m trying to do the same using SPI, but sometimes it doesn’t work.
(At the moment I’m using an Arduino Due to speed up the tests)
What I do is this every 5 seconds:
[list]
[]open communication (Chip select pin low)
[]send 0x0C and 0x00
[*]close communication (Chip select pin high)
[]while length==0x00 && less than 4" are passed:
[list]
[]open communication (Chip select pin low)
[]send 0xff and length = read data
[]close communication (Chip select pin high)
[/list]
[]if length != 0x00 && length != 0xFF
[list]
[]open communication (Chip select pin low)
[]for a number of times equals to the length:
[list]
[]send 0xff and read data
[/list]
[*]close communication (Chip select pin high)
[/list][/list]
I don’t know if this is totally correct, in particular if it’s needed to close and reopen communication or if it just need a to wait some time.
Sometimes (20% of cases) I get answers which don’t make sense.
For example I get 0xff for the length, like it didn’t get my query, or i get other value that I don’t understand.
(I attach the arduino code that I’m using for these test)
Thanks for the help