Low level 802.15.4 transmit code

I am trying to make a simple MAC-layer transceiver using Arduino environment.  I have some code derived from this example: https://github.com/IoTS-P/nRF52-802154-Raw-Transmitter
and have discovered that it hangs after one to a few hundred transmissions.  I have gone over the datasheet for the 802.15.4 radio section and I do not see where the problem is.I am using a Zena receiver to monitor the transmissions.  I noticed that the CCA appears to take some tens-of-mS fairly often while the Zena does not show any other messages arrived during that time.  What am I doing wrong with the radio hardware?

<project files attached>

  • I have found the problem, it is a combination of two issues.  1. The code as written relies on an interrupt from the radio to clear a transmit flag.  There are some rare cases where this interrupt is lost and the flag is never cleared. 2. The radio does indeed need full re-initialization in some cases but this is even rarer than #1.

    Statistics: 700,000 messages, 1 reset needed, then a thunderstorm blew through and in 500,000 messages, 14 resets were needed.  With a code change that clears the interrupt flag, and only resets of that did not work:  1,099,000 messages, flag cleared 6 times, reset once.  I believe this resolves the issue.

    Thank you for your help.

Related