Delayed Tx using SDK

Hi all,

This is my first post, so, i’m introducing myself first here. I am Nick, an Embedded Engineer working for a startup and we are trying to develop a Double-sided TWR solution using DWM1001 module using nRF and Decawave SDK.

The question i have is, how to compute the optimum delay time, for delayed transmission. I have looked at the ss_twr_resp example and it uses 1100uus for the sample tx message. We are using custom message, about the same size as sample tx message, but in all the different delay time i use, the dw1001 transmits after the clock rollover. I tried using lower delay time and larger delay times but no improvement.

I have read the another thread explaining the behavior if the delay time is too low or too far or just enough, that was helpful but i am still confused and stuck.

I used systime to read the current timestamp to see if my delay was too low that the tx time had passed, but it’s not the case. I am attaching the timestamps from my sample output below.

delay time : 2400 (uus)
Received Timestamp :2497207878
Sys Ts :2497540808 – timestamp after reading Rx timestamp
Resp Tx Time :10369118
Sys Ts :2497605972 – timestamp after calculating resp tx time
Tx Timestamp :2654510664
Sys Ts :2497694082 – timestamp after writing message into buffer and starting tx
Diff :486550 – Difference in time from Received Timestamp and starting tx. (i.e, time taken for nordic to write message into buffer)

I feel there must be sufficient time for the transmitter to power up and start tx. But, am i missing something here ?

The dwt config i am using is as below, with 2048 preamble length and 110k datarate.

static dwt_config_t sConfig = {
5, /* Channel number. /
DWT_PRF_64M, /
Pulse repetition frequency. /
DWT_PLEN_2048, /
Preamble length. Used in TX only. /
DWT_PAC32, /
Preamble acquisition chunk size. Used in RX only. /
9, /
TX preamble code. Used in TX only. /
9, /
RX preamble code. Used in RX only. /
1, /
0 to use standard SFD, 1 to use non-standard SFD. /
DWT_BR_110K, //DWT_BR_110K, /
Data rate. /
PHY header mode. /
(2048 + 64 - 32) /
SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */

Any suggestion or help is highly appreciated.

Thanks in advance,