4.5.1 SNIFF mode
In SNIFF mode the DW1000 alternates between the RX (on) and the IDLE (off) states. To enable SNIFF mode two parameters SNIFF_ONT (sniff on time) and SNIFF_OFFT (the off time) need to be configured in Register file: 0x1D – SNIFF Mode. The on duration is programmed in units of PAC, (these are described in section 4.1.1 – Preamble Detection), and must be set to at a minimum value of 2 for functional preamble detection. The off duration is programmed in units of 1 μs. When both on and off durations are programmed with non-zero values SNIFF will be operational from the next RX enable.
As an example if the PAC size is 8 symbols, (this is approximately 8 μs), and we want to have a 50:50 on-off duty cycle, then we could set SNIFF_ONT to its minimum of 2 PAC intervals and the SNIFF_OFFT to a value of 16 μs.
Figure 19 shows the power profile associated with SNIFF mode where the IC wakes up from SLEEP and
progress into the repeated IDLE-RX-IDLE-RX… duty-cycle of the pulsed preamble detection mode. A timeout
ends this and the DW1000 is returned to SLEEP.
Figure 19: Power profile for SNIFF where a frame is not received
Figure 20 shows a power profile for SNIFF mode, similar to Figure 19, except in this case preamble is
detected on the second period of RX sampling, and the DW1000 completes the reception of a frame.
Figure 20: Power profile for SNIFF where a frame is received
设置嗅探模式:
dwt_setrxmode(DWT_RX_SNIFF, 0x02, 0x0f); //嗅探模式2倍PAC,15uus
uus:基于dw1000内部时钟,1uus=1.056us.
开始嗅探:
/* Clear reception timeout to start next ranging process. */
dwt_setrxtimeout(0);
/* Activate reception immediately. */
dwt_rxenable(0);
定时嗅探:将以上两条语句放入定时器中,即可。
接收:正常接收即可