Skip to content

Configuring the DW1000

Daniel King edited this page Sep 12, 2019 · 3 revisions

Before the DW1000 can be used it must be initialized and configured. Luckily, the DecaDriver provides a couple of subprograms to do just that! They are explained on this page.

Initializing the driver

The driver is initialized using the DecaDriver.Driver.Initialize procedure. This is typically called once after each time the radio is reset (e.g. once on program startup). Here's a example of its typical use:

DecaDriver.Driver.Initialize
   (Load_Antenna_Delay  => True,
    Load_XTAL_Trim      => True,
    Load_UCode_From_ROM => True);

The parameters to Initialize have the following meaning:

  • Load_Antenna_Delay - Set to True if the antenna delay values should be loaded from the DW1000's one-time programmable (OTP) memory and cached in the driver. These values will be used by the Configure procedure.
  • Load_XTAL_Trim - Set to True if the DW1000 should be configured with the XTAL trim value stored in the DW1000 OTP memory.
  • Load_UCode_From_ROM => Set to True to load the leading edge detection (LDE) microcode to the DW1000. This must be True if timestamping of received packets is to be used.

Configuring the driver

The DecaDriver.Driver.Configure is used to configure the DW1000 transmitter and receiver to operate with specific settings (UWB channel, data rate, etc...). An example is shown below:

DecaDriver.Driver.Configure
   (DecaDriver.Configuration_Type'
       (Channel             => 1,
        PRF                 => PRF_16MHz,
        Tx_Preamble_Length  => PLEN_64,
        Rx_PAC              => PAC_8,
        Tx_Preamble_Code    => 1,
        Rx_Preamble_Code    => 1,
        Use_Nonstandard_SFD => False,
        Data_Rate           => Data_Rate_110k,
        PHR_Mode            => Standard_Frames,
        SFD_Timeout         => 64 + 64));

The configuration parameters are described below:

  • Channel - The UWB channel on which to operate. The DW1000 supports channes 1 .. 5 and 7.
  • PRF - The mean pulse repetition frequency (PRF) to use. Can be either PRF_16MHz or PRF_64MHz. This value must be correct for the preamble codes in use. More on this below.
  • Rx_PAC - The preamble acquisition chunk (PAC) length. I.e. the number of preamble symbols in a chunk to cross-correlate when searching for a preamble. A bigger PAC improves receiver performance, but must not be too large for the preamble length.
  • Tx_Preamble_Code - The preamble code to use when sending frames.
  • Rx_Preamble_Code - The preamble code to use when receiving frames.
  • Use_Nonstandard_SFD - Set to False if the start of frame delimiter (SFD) sequence should be used as defined by the IEEE 802.15.4-2011 standard. Otherwise, set to True to use the DecaWave-defined SFD sequence.
  • PHR_Mode - Set to Standard_Frames if the maximum PDU length is 127 octets, as defined by the IEEE 802.15.4-2011 standard. Otherwise, set to Extended_Frames if the non-standard frame format is used, supporting up to 1024 octets.
  • SFD_Timeout - The maximum amount of time, in symbols, to wait while searching for the SFD after the preamble is detected. More on this below. It is not recommended to ever set this to zero.

The PRF should be either 16 MHz or 64 MHz depending on the preamble code in use. Preamble codes 1 .. 8 should use 16 MHz PRF, and other preamble codes 9 .. 24 must use the 64 MHz PRF.

The Rx_PAC should be set to a sensible value based on the expected preamble length of received frames. Table 6 in the DecaWave User Manual provides the recommended PAC size for the expected received preamble length. This is also shown here for convenience:

Expected Rx Preamble Length Recommended PAC Size
64 8
128 8
256 16
512 16
1024 32
1536 64
2048 64
4096 64

The recommended SFD_Timeout is the total number of preamble + SFD symbols. Note that when using the standard SFD sequence, the SFD has a length of 64 symbols using the 110 kbps data rate, and 8 symbols when using the 850 kbps or 6.8 Mbps data rates. Here are some examples of recommended SFD timeouts for different configurations using the standard SFD:

Expected Rx Preamble Length Data Rate Recommended SFD Timeout
64 110 kbps 64 + 64
64 850 kbps 64 + 8
64 6.8 Mbps 64 + 8
1024 110 kbps 1024 + 64
1024 850 kbps 1024 + 8
4096 6.8 Mbps 4096 + 8

If you don't know the expected preamble length then set the SFD timeout to 4096 + 64 (the biggest possible value).

Clone this wiki locally