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

RADIO Power Control for Register reset

Hello, I'm working on timeslot and RADIO on nRF52840.

I found a sample code which sets 1 to "NRF_RADIO->POWER" to initialize RADIO peripheral.

-------------------------------------------------
/* Reset all states in the radio peripheral */
NRF_RADIO->POWER = 1;
-------------------------------------------------

However, the description in "6.20.14.39 POWER" is somewhat different.

-------------------------------------------------
Peripheral power control. The peripheral and its registers will be reset to its initial state by switching the peripheral off and then back on again.
-------------------------------------------------

It is clearly saying that the POWER should be set to "0' and then "1" like following, isn't it?

-------------------------------------------------
/* Reset all states in the radio peripheral */
NRF_RADIO->POWER = 0;
NRF_RADIO->POWER = 1;
-------------------------------------------------

Parents Reply
  • Thank you for the answer.

    You have even answered to my next question for the time of turning on/off.

    1. By the way, is the register readable even when power is down?

    2. Is the register reading blocking action? (ie. line 3 "(void)NRF_RADIO->EVENTS_DISABLED;" is waiting until power is completely down/up?)

    3. Then, is following the proper way to start RADIO operation in timeslot?

    NRF_RADIO->POWER = 0;
    
    /* Dummy read of random volatile register. Wait state to ensure write */
    (void)NRF_RADIO->EVENTS_DISABLED;
    
    NRF_RADIO->POWER = 1;
    
    /* Dummy read of random volatile register. Wait state to ensure write */
    (void)NRF_RADIO->EVENTS_DISABLED;
    
    NRF_RADIO->TASKS_TXEN = 1;

     

Children
Related