Start of frame detect interrupts

Hi all,

I am looking to get interrupts from the DW1000 not just when a frame has been successfully received or an error occurred, but also when a “start of frame” has been detected. Looking through the documentation I should be able to do so, however, the Decawave provided drivers do not include any defined symbols for these settings.

My question is. Is there a device reason why these interrupts weren’t surfaced in the API?
If I want to receive both, SFD and RXFG events the SPI interface even at 20MHz might be a bit too slow to read the status register and clear the appropriate interrupt bit. Can one leave the SFD interrupt bit unchanged until the end of frame bit gets set? In other words, would the following sequence happen:

  1. Preamble detected
  2. Start of Frame detected, generate interrupt (pulse interrupt line)
  3. Interrupt handler reads the status register and does the processing it needs to do.
  4. End of Frame detected, generate interrupt (pulse interrupt line)
  5. Interrupt handler reads the status register and does the processing it needs to do and clears all pending receive interrupts.

JM

Hi,

You can get an interrupt when Preamble is detected :

// Add RXPRD interrupt : interrupt when preamble detected
int INT_RXPRD = 0x100;

/* Enable wanted interrupts (TX confirmation, RX good frames, RX timeouts, RX errors and Preamble detected). */
dwt_setinterrupt(DWT_INT_TFRS | DWT_INT_RFCG | DWT_INT_RFTO | DWT_INT_RXPTO | DWT_INT_RPHE | DWT_INT_RFCE | DWT_INT_RFSL | DWT_INT_SFDT | INT_RXPRD, 1);

Is it what you are looking for ?

Xavier

Thanks Xavier,

I amended the decawave driver to handle:
#define DWT_INT_TXFRB 0x00000010 // TxFrame begins
#define DWT_INT_RXSFD 0x00000200 // Rx Start of frame detected
I also added two more callbacks to the dwt_setcallbacks signature to handle the above events in user code.

Happy to report it all works nicely now :slight_smile:

JM