Beware that this post is related to an SDK in maintenance mode
More Info: Consider nRF Connect SDK for new designs
This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Radio Test - transmitter example

Hi,

I have nRF52840 DK, and using nRF SDK v17. I am trying to understand radio transmitter example sendpacket().

RTC(1) seems to be used to the transmitting packet.

ret_code_t app_timer_init(void)
{

   ...
    err_code = NRF_ATFIFO_INIT(m_req_fifo);
 
    err_code = drv_rtc_init(&m_rtc_inst, &config, rtc_irq);

    drv_rtc_overflow_enable(&m_rtc_inst, true);
    drv_rtc_compare_set(&m_rtc_inst, 1, DRV_RTC_MAX_CNT >> 1, true);
    if (APP_TIMER_KEEPS_RTC_ACTIVE)
    {
        drv_rtc_start(&m_rtc_inst);
    }

    m_global_active = true;
    return err_code;
}

If I comment out  (In main.c)    err_code = app_timer_init();  it will stop sending radio packet. 

I traced rtc timer  (in app_timer2.c), all the following functions related to RTC(1) timer are not called (break points don't hit)

void rtc_update(drv_rtc_t const * const  p_instance); 

void timer_req_process(drv_rtc_t const * const  p_instance);

void rtc_irq(drv_rtc_t const * const  p_instance);

void timer_request_proc_trigger(void);

ret_code_t timer_req_schedule(app_timer_req_type_t type, app_timer_t * p_timer);

What is the role of this timer in the sending of radio packets?

Thank you,

David Zhou

Parents
  • Hi,

    It seems to me that without app_timer_init() is ok. Actually it needs:

            // Start 64 MHz crystal oscillator.
        NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
        NRF_CLOCK->TASKS_HFCLKSTART    = 1;

    But I don't know why the radio needs the CLOCK. It it possible using low frequency crystal oscillator?

    Ok. Clock HFXO is required for Radio Tx/Rx.

    But now the question is, it has to use 64MHz? And When needs to turn on the clock or can be turn off after transmitting/Receiving to save power consumption?

    Ok. The main thing is the TX power is at 80mA at peak. I have already set tx_power level to -40dBm. What I do have to do in order to bring down the power consumption?

    Ok. I found that

            nrf_rng_task_trigger(NRF_RNG_TASK_START); shall be managed. It takes 3mA constantly.

    More need to investigate.

    Thank you,

    David Zhou

Reply
  • Hi,

    It seems to me that without app_timer_init() is ok. Actually it needs:

            // Start 64 MHz crystal oscillator.
        NRF_CLOCK->EVENTS_HFCLKSTARTED = 0;
        NRF_CLOCK->TASKS_HFCLKSTART    = 1;

    But I don't know why the radio needs the CLOCK. It it possible using low frequency crystal oscillator?

    Ok. Clock HFXO is required for Radio Tx/Rx.

    But now the question is, it has to use 64MHz? And When needs to turn on the clock or can be turn off after transmitting/Receiving to save power consumption?

    Ok. The main thing is the TX power is at 80mA at peak. I have already set tx_power level to -40dBm. What I do have to do in order to bring down the power consumption?

    Ok. I found that

            nrf_rng_task_trigger(NRF_RNG_TASK_START); shall be managed. It takes 3mA constantly.

    More need to investigate.

    Thank you,

    David Zhou

Children
Related