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

  • Hi David,

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

    The app_timer is used by the Board Support Package (BSP) module. This is the module responsible for indicating certain states on LEDs, such as BSP_INDICATE_SENT_OK to indicate that the packet was sent, and to handle button events. In the example, upon receiving a button event, the button state will be read. If this is true, that is a button is pressed, it will tell the program that there is a packet to transmit. The radio will then be enabled, and when an event is ready the packet is transmitted.

    I have asked internally about your question regarding current consumption, and I will get back to you regarding this next week.

    Best regards,

    Marte

  • Hi David,

    Are you using PPK1 or PPK2 to measure the current consumption? The peak you are getting in your measurement is the peak current of PPK1, which can mean you have a short circuit somewhere. We have seen this happen with the PPK1 before, giving current measurements around to 80 mA.

    Even so, the current consumption is most likely not actually 80 mA. According to nRF52840 radio transmitting/receiving current consumption, you should expect to get around 5 mA with -40 dBm output power. Even if something was configured incorrectly and output power was set to maximum you should not get more than 20 mA.

    Best regards,

    Marte

  • Hi Marte,

    I am using PPKI. Maybe it reaches cut-off 80mA. After I managed nrf_rng_task_trigger(NRF_RNG_TASK_START) and HFXO, the Maximum current is down to 35mA. I know there are some rooms to go. I just need to go through all the steps and to minimize power. I am ok at this point.

    Thank you very much.

    David Zhou

  • Hi Marte,

    I have an urgent question, I would like to turn on DCDC regulator. In the radio_cmd.c file, (radio_test, or transmitter projects),

    void toggle_dcdc_state(uint8_t dcdc_state)
    {
        if (dcdc_state <= 1)
        {
            NRF_POWER->DCDCEN = dcdc_state;
        }
    }

    But in this link:

    https://devzone.nordicsemi.com/f/nordic-q-a/33233/enable-dc-dc-regulator-without-an-external-lc-filter

    and PDF document states that it needs internal LC filter.

    So why it the toggle_dcdc_state function simply turns on DCDCEN regulator without ensuring LC filter? Is the LC filter on the nRF52840 DK board always connected?

    Or simpler question: NRF_POWER->DCDCEN =0 or 1 is save to the DK board?

    Otherwise, how to turn on the LC filter?

    OK, I set it anyway.

    NRF_POWER->DCDCEN = POWER_DCDCEN_DCDCEN_Enabled << POWER_DCDCEN_DCDCEN_Pos;

    It seems working ok.

    Thank you,

    David Zhou

  • Hi David,

    TigerD said:
    Or simpler question: NRF_POWER->DCDCEN =0 or 1 is save to the DK board

    Setting DCDCEN to 1 enables the DC/DC regulator for REG1 stage.

    If you do not connect an external LC filter when DC/DC regulator is enabled you might damage the chip. Please see the reference circuitry for the nRF52840 SoC. When looking at the different circuit configurations, you will see that when DCDCEN0 and/or DCDCEN1 are enabled there are LC filters connected for each of the DC/DC regulators, such as the inductor L4 between VDD and DCCH in circuit configuration no. 4.

    Best regards,

    Marte

Reply Children
No Data
Related