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

Help on TASKS_HFCLKSTART vs TASKS_LFCLKSTART for ESB...

Hi

I am giving a try to ESB as an alternative to BLE. I am starting with esb_prx and esb_ptx sample.

That sample works on DK boards.

In order to save energy I would like to rely on LFCLK instead of HFCLK (default for sample). So I changed the clocks_start function from this:

void clocks_start( void )
{
    NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_HFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_HFCLKSTARTED == 0);
}

to this:

void clocks_start( void )
{
    NRF_CLOCK->EVENTS_LFCLKSTARTED = 0;
    NRF_CLOCK->TASKS_LFCLKSTART = 1;
    while (NRF_CLOCK->EVENTS_LFCLKSTARTED == 0);
}

on both tx and rx applications.

But when relying on LFCLK, sample does not communicate anymore.

On documentation and forum we can read that it is not possible to use BLE using LFCLK but what about ESB?

Is it possible to keep ESB samples communicating when relying on LFCLK. If not, why?

Thanks a lot

Alex

Parents
  • Hi,

     

    ESB is a very basic protocol, that only handles auto ACK'ing and retransmissions, and does not have any sort of "link established" states. It sends/receives payloads on a specific RF address and channel.

    The RADIO peripheral requires the external HFCLK to run, as the internal 64M RC oscillator has too high of a tolerance to successfully generate a 2.4 GHz signal. You can potentially dynamically start/stop the HFCLK if you're a primary transmitter (PTX), but if you're a primary receiver (PRX), the HFCLK should always run.

     

    Kind regards,

    Håkon

  • "...to successfully generate a 2.4 GHz signal"

    Understood!

    And yes, I am the primary transmitter, so I can turn it on and off in the right timings.

    Is it a good idea to turn off HFCLK to save energy while keeping LFCLH to generate app timers? Or it is more eficient keep the HFCLK to drive transceiver and to drive timers while keeping LFCLK turned off?

    Thank you

Reply Children
Related