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

Reply
  • 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

Children
  • Hi Håkon! Thank you for your responce! I have tried your code, but power consumption still 30uA... Now my test code is:

    void main()
    {
    __xdata __at(0x0100) unsigned int count; //counter for loop
    uint8_t i;
    
    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;
    
    for (i = 0; i < 8; i ++)
      {
        P0CON = 0x70 | i;
        P1CON = 0x70 | i;
        P2CON = 0x70 | i;
        P3CON = 0x70 | i;
      }
    
       pwr_clk_mgmt_enter_pwr_mode_memory_ret_tmr_on(); // 1uA
    
    }
    
    }
    
  • Hi,

    Is the external sensors pin DQ pulled high using an external pull resistor? I have not used this specific sensor before, but it is set to a sleep state when setting the LE1 to memory retention? Have you tried removing this sensor from the design and seeing the same current consumption?

  • Hi, Yes of course, I'm trying to achieve 1-2 uA without any external peripherals. Only power supply (2xAA batteries) are connected. I checked the current by two different multimeters. One more fact: during two weeks voltage on two AA batteries dropped from 3,14V to 3,12V.

  • Sorry, had to check if you had anything else connected to the nRF. Could you try setting "OPMCON |= 0x02;" prior to going into memret? Also remember to "unlock" this in your init by setting it to "OPMCON = 0x00;" and see if this has any effect?

    Cheers, Håkon

  • I just tried it in deep sleep mode. Power supply voltage is 3,19V (new batteries AA). With "OPMCON |= 0x02;" current is 31 uA. Without it current is 29 uA. So, my test code is:

    #include <Nordic\reg24le1.h"
    
    void mcu_init(void)
    {
    OPMCON = 0x00;
    P0 = 0x00;
    P1 = 0x00;
    P2 = 0x00;
    P3 = 0x00;
    
    P0DIR = 0x00;
    P1DIR = 0x00;
    P2DIR = 0x00;
    P3DIR = 0x00;
    
    }
    
    void main(void)
    {
    	
    	int i;
    mcu_init();
    
      for (i = 0; i < 8; i ++)
      {
        P0CON = 0x70 | i;
        P1CON = 0x70 | i;
        P2CON = 0x70 | i;
        P3CON = 0x70 | i;
      }
    OPMCON |= 0x02;
    PWRDWN = 0x01;
    
    while(1);
    }
    

    I tried it with two types of boards: with this one: i62.tinypic.com/727i9g.jpg and with this one: i59.tinypic.com/6p6pua.jpg

    I use uVision v9.51

Related