dwt_writetxfctrl and ranging bit

Hello,

I’m a PhD student playing with localization. Currently I’m in the simple MAC layer implementation for DW1000 and I’ve stumbled upon a problem, and I’m curious if maybe somebody can validate this behaviour.

IEEE 802.15.4 defines ranging bit to differentiate ranging packets from general DATA packets. To set it, I’ve used dwt_writetxfctrl API function. Also I’ve validated that correct value was indeed written to corresponding register.

From what I can see, setting or clearing this bit has no effect on the receiving end. In other words, cb_data->rx_flags is always 0. I’ve checked API implementation and I can’t seem to find a error. Am I missing something?

Thx in advance!

Hey Hrvoje,

as indicated in the User Manual page 74 ‘This bit has no operational effect on the DW1000’. I think this should answer your question. So it does not have an effect on the receiving end, but you could use this bit for your protocol implementation, because this bit is also copied in the PHR of the transmitted frame.

BR,
Bernhard
Graz University of Technology

Hello Bernhard,

thx for answer.

Maybe I wasn’t clear. I get that flag doesn’t have any operational effect since DW1000 is time stamping all transmissions.

I have two DW1000 chips that are communicating and ranging flawlessly. Problem is that I don’t see Ranging bit on the receiving end in PHR if I set it in TX_FCTR on transmitting end. Basically, I can’t use it in protocol since it appears that the flag is not transferred. Data rate and frame length are transferred correctly.
So I’m not sure if this is a bug in a chip or intendant behaviour. From what I read in datasheet and user manual, as you previously stated, this bit should be copied to PHR frame and transmitted. I can’t see that behaviour.

BR,
Hrvoje

Hi Hrvoje,

I have tried the simple examples, and reading frame info (register 0x10) shows ranging bit set, if it is set in the transmitter end.

Are you sure you are setting it correctly?

Zoran

Hi Zoran,

can you do one more test? Change it to zero and check if the receiving side has zero also.

Because, I’ve also used simple tx rx example also and with it ranging bit was always set to one even if I put 0 in TX_FCTR.

If this passes then something weird is happening in my code and I need to shovel deeper with gdb.

BR,
Hrvoje

Hi,

in my RTLS application, I’m transmitting ranging and non-ranging messages.
The receiver is able to distinguish them by their RNG bit. So it seems to be transmitted correctly.

regards,

Gregor

Hello,

thx for the info.

This is very strange and I don’t know what’s happening on my end. Only if I change length of the frame, RNG bit changes on the receiving side.

It must be that I’m messing something up in registers concerning PHR frame. I just need to find out what exactly.

BR,
Hrvoje

Got it!

There are DWT_PHRMODE_EXT and DWT_PHRMODE_STD modes. In case of DWT_PHRMODE_EXT PHR has different structure. Among other things it doesn’t have RNG bit altogether. Frame length consumes RNG bit, Header Extension and one bit from Preamble duration.

So for RNG bit you must use DWT_PHRMODE_STD frame length.

There goes a day and a half!

Thx again for your help,
Hrvoje