DWT_TIME_UNITS significans in coding

Hi Everyone,

I studied Initiator and responder codes from the examples. But i have doubt there
DWT_TIME_UNITS = (1.0/499.2e6/128.0) //!< = 15.65e-12 s this i found in the deca_device_api.h file. i would like to know more about this calculation.
How we need to choose this calculation.

Thanks,
Anil.

1 Like

yes i studied and i understood much things, some points like this i didn’t understand so posted.

Thanks for you suggestion.
Anil

The main decawave clock is 499.2 MHz which is where the 1/499.6e6 is from.
For the internal registers each clock cycle is oversampled by a factor of 128 (don’t worry about exactly how) meaning that the internal clock registers that track transmit and receive time are working in time units of 1/128th of a clock cycle. So that the internal time registers are counting at a rate of 128*499.2e6 MHz giving a tick period of around 15e-12 s or 15 ps.
Which works out as just under 5 mm at the speed of light.