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
  • Hi,

     

    jake.yoon said:
    1. By the way, is the register readable even when power is down?

    Yes, the register is readable when .POWER=0.

    To generate the wait state, you could read any EVENTS_* register, for instance (void)NRF_TIMERx->EVENTS_COMPARE[0];

     

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

     Its ensuring a 16 MHz cycle wait is introduced, as all peripherals are running on the PCLK16M.

     

    jake.yoon said:
    Then, is following the proper way to start RADIO operation in timeslot?

    Yes. Write .POWER=0, 1 cycle wait on 16M peripheral clock tree, write .POWER=1.

     

    Kind regards,.

    Håkon

Children
Related