This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

How does radio behave if HFXO is not stable?

When you start a receive task, what will the radio do if the HFXO is not stable? Not begin to ramp up until the HFXO is stable, OR begin to ramp up but not become active until the HFXO is stable, OR rampup and become active (possibly returning CRC errors until the HFXO is stable), OR some other behaviour such as do nothing until you start another receive task while HFXO is stable?

The rest is a discussion of my current understanding. You should "manually" start the HFXO before using the radio because the radio "needs" the HFXO which is more accurate than the HFRC. Most examples from Nordic seem to wait a fixed amount of time (say 1.6msec) after starting the HFXO. That amount of time is "ample" since a typical HFXO startup time is say 1.2mSec on the NRF51 and say 0.36mSec on the NRF52. But those numbersare not specified by Nordic since the crystal and its related components are off the Nordic chip. A sampled startup time also might vary slightly from session to session (a sample of startup times is statistically distributed, depends on temperature.) Instead of waiting a constant time (as in most Nordic examples), you can also sleep on an interrupt from event HFCLOCK_STARTED (which is misnamed and really means "is running stably.")

  • Yes, my typo again. Really sorry for that :(

    You are correct, it varies that's why Stian have to make an assumption of 1.5ms as of worse case. If you start the radio before the HFXO is ready, of course it's high chance that the signal from the radio will be corrupted, deviated. If in your application, the radio need to be turned on at an exact point in time, my suggestion is to setup the timer to wake CPU up before the radio needs to be on about 1.5ms. Then start HFXO, then put the CPU back to sleep. Wake up again when the radio need to be on, check if HFXO is running, if yes then start the radio, if not, skip that event (or wait longer if there is not real time requirement). You need to have the rough estimation of worse case scenario on how long the HFXO takes to start.

Related