How does the DWM1000 write the sending timestamp to the packet when sending the packet?

Hi,I am new to the community, now I have node 1 and node 2, when node 1 sends a packet to node 2, I want to write the send timestamp of node 1 in the packet. Can anyone provide me a demo of this code? My code: when node2 parses the nth packet, it finds that the send timestamp of node1 is always the send timestamp of the n-1st send

You can’t include the send timestamp of a packet before you send the packet, you won’t know what it is.

The one exception is if you are using the delayed transmit function, this allows you to set the transmit time for the packet. When doing this you can then include the transmit time in the message since you know it in advance.
Delayed transmit has two limitations - Firstly when setting a time the low 9 bits of the time value are always zero. Secondly the scheduled time will be the internal time within the chip, it will not take antenna transmit delay into account.
So if you schedule a transmit for time X then the actual transmit time will be (X&~0x01ff) + Antenna Tx Delay

When trying to send a reply a fixed time after receiving a message the normal practice is to schedule the transmit for (Ideal time - Tx Antenna delay) and then include (Ideal time - Tx Antenna delay)&0x01ff in the message data. The receiver can then take it’s receive time and add the error value included in the message to get the receive time if the message had been sent at the ideal time.

1 Like