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

nrf24le1 power consumption

Hi all! Several weeks I've tryed to implement code for my wireless temperature sensor based on nrf24le1 and ds18b20. In datasheet said that in memory retention mode the power consumption is around several uA. All of what I have achieved is 29-30 uA consumption. There is a sample code I tryed (without any including): blink after 6 seconds of "memory retention timers on":

void main()
{
__xdata __at(0x0100) unsigned int count; //counter for loop

pwr_clk_mgmt_cclk_configure(PWR_CLK_MGMT_CCLK_CONFIG_OPTION_START_ONLY_XOSC16M | PWR_CLK_MGMT_CCLK_CONFIG_OPTION_XOSC16M_IN_REGISTER_RET_OFF);

pwr_clk_mgmt_clklf_configure(PWR_CLK_MGMT_CLKLF_CONFIG_OPTION_CLK_SRC_RCOSC32K);
pwr_clk_mgmt_wait_until_clklf_is_ready();
gpio_pin_configure(GPIO_PIN_ID_P0_0,GPIO_PIN_CONFIG_OPTION_DIR_OUTPUT);


rtc2_configure(RTC2_CONFIG_OPTION_COMPARE_MODE_0_RESET_AT_IRQ ,65535); //65535=2 sec, 32767=1 sec
rtc2_run();


pwr_clk_mgmt_wakeup_configure(PWR_CLK_MGMT_WAKEUP_CONFIG_OPTION_WAKEUP_ON_RTC2_TICK_ALWAYS,0);

sti();
   //main program loop

   while(1)
   {


count++;
if (count>2){

gpio_pin_val_set(GPIO_PIN_ID_P0_0); 
    delay_ms(500); 
gpio_pin_val_clear(GPIO_PIN_ID_P0_0); 



  count=0;

   }    
//   adc_power_down();   
//   rf_power_down();

P0DIR=0xFF;
P1DIR=0xFF;
P2DIR=0xFF;
P3DIR=0xFF;

P0CON=0x70;
P1CON=0x70;
P2CON=0x70;
P3CON=0x70;

   pwr_clk_mgmt_enter_pwr_mode_memory_ret_tmr_on(); // 1uA

}

}

It's works, but power consumption is 29-30 uA in memory ret. mode. Is there any mistake? Does anybody achieved consumption of 1-2 uA, as said in datasheet? My goal is to implement sensor which will work on two AA elements during at least one year.

Parents
  • Hi,

    You'll need to disconnect all the pin buffers internally in the nRF24LE1 in order to make sure that GPIOs are not floating.

    This can be done similar to this:

    void disconnectGPIO()
    {
      uint8_t i;
      for (i = 0; i < 8; i ++)
      {
        P0CON = 0x70 | i;
        P1CON = 0x70 | i;
        P2CON = 0x70 | i;
        P3CON = 0x70 | i;
      }
    }
    

    Note that this will disconnect all GPIOs, you'll need to mask out the one's that are in use.

    Cheers, Håkon

  • Hi Håkon, Sorry for delaying with answer. I just tried this code from example:

    #include <Nordic\reg24le1.h>
    #include <stdint.h>
    #include "hal_clk.h"
    #include "hal_rtc.h"
    
    uint8_t xdata toggle;
    
    void mcu_init(void)
    {
    // XOSC32K input
    P0DIR = 0x00;
    P1DIR = 0x00;
    P2DIR = 0x00;
    P3DIR = 0x00;
    
    P0 = 0x00;
    P1 = 0x00;
    P2 = 0x00;
    P3 = 0x00;
    
    // Open latch
    OPMCON = 0x00;
    }
    
    void wakeup_tick() interrupt INTERRUPT_TICK
    {
    // Toggle output on wakeup
    P02 = toggle;
    toggle = !toggle;
    }
    
    void main(void)
    {
    mcu_init();
    
    // If wakeup from tick, turn on LED
    if(PWRDWN & 0x40)
    {
    IEN1 = 0x20;
    EA = 1;
    // Go to standby mode and wait for RTC interrupt
    PWRDWN = 0x07;
    // Clear power down
    PWRDWN = 0x00;
    }
    else
    {
    // Init RTC timer
    /*
    hal_rtc_start(false);
    hal_clklf_set_source(HAL_CLKLF_XOSC32K);
    hal_rtc_set_compare_mode(HAL_RTC_COMPARE_MODE_0);
    hal_rtc_set_compare_value(0x7FFF);
    hal_rtc_start(true);
    */
    }
    
    // Lock latch
    OPMCON |= 0x02;
    
    // Memory retention mode timer on, system reset on wakeup
    PWRDWN = 0x03;
    while(1);
    }
    

    Result is the same: 31 uA...

Reply
  • Hi Håkon, Sorry for delaying with answer. I just tried this code from example:

    #include <Nordic\reg24le1.h>
    #include <stdint.h>
    #include "hal_clk.h"
    #include "hal_rtc.h"
    
    uint8_t xdata toggle;
    
    void mcu_init(void)
    {
    // XOSC32K input
    P0DIR = 0x00;
    P1DIR = 0x00;
    P2DIR = 0x00;
    P3DIR = 0x00;
    
    P0 = 0x00;
    P1 = 0x00;
    P2 = 0x00;
    P3 = 0x00;
    
    // Open latch
    OPMCON = 0x00;
    }
    
    void wakeup_tick() interrupt INTERRUPT_TICK
    {
    // Toggle output on wakeup
    P02 = toggle;
    toggle = !toggle;
    }
    
    void main(void)
    {
    mcu_init();
    
    // If wakeup from tick, turn on LED
    if(PWRDWN & 0x40)
    {
    IEN1 = 0x20;
    EA = 1;
    // Go to standby mode and wait for RTC interrupt
    PWRDWN = 0x07;
    // Clear power down
    PWRDWN = 0x00;
    }
    else
    {
    // Init RTC timer
    /*
    hal_rtc_start(false);
    hal_clklf_set_source(HAL_CLKLF_XOSC32K);
    hal_rtc_set_compare_mode(HAL_RTC_COMPARE_MODE_0);
    hal_rtc_set_compare_value(0x7FFF);
    hal_rtc_start(true);
    */
    }
    
    // Lock latch
    OPMCON |= 0x02;
    
    // Memory retention mode timer on, system reset on wakeup
    PWRDWN = 0x03;
    while(1);
    }
    

    Result is the same: 31 uA...

Children
No Data
Related