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

nRF9160 power consumption measurement in PSM Mode without any data transfer

1. Is there any document available from Nordic that describes the exact steps to measure power consumption in PSM mode with the Dev Kit? Also, is there a test firmware available to test exactly this?

2. If the answer to #1 is No, then can you check and let me know if the following steps are correct to put the chip into PSM mode (lets say ping the tower every 60 seconds but no data transmission at all) ? (We basically want to see what is the power consumption during sleep and also when pinging the tower and no other other data transfer happens)

Steps I gathered so far:

1. Install firmware version v1.1.0
2. I cannot find udp_with_psm  project mentioned in this link in v1.1.0 firmware repository,, so is it OK to use the default tracker project? ( C:\ncs\nrf\applications\asset_tracker )
3. Disable serial in prj file.
Adding the CONFIG_SERIAL=n flag to the prj.conf file in the project folder.
Adding the CONFIG_SERIAL=n to the SPM prj.conf file. This is located in the SDK_ROOT/nrf/samples/nrf9160/spm folder.
3. setup psm mode

#include <lte_lc.h>


void setup_psm(void)
{
/*
* GPRS Timer 3 value (octet 3)
*
* Bits 5 to 1 represent the binary coded timer value.
*
* Bits 6 to 8 defines the timer value unit for the GPRS timer as follows:
* Bits
* 8 7 6
* 0 0 0 value is incremented in multiples of 10 minutes
* 0 0 1 value is incremented in multiples of 1 hour
* 0 1 0 value is incremented in multiples of 10 hours
* 0 1 1 value is incremented in multiples of 2 seconds
* 1 0 0 value is incremented in multiples of 30 seconds
* 1 0 1 value is incremented in multiples of 1 minute
* 1 1 0 value is incremented in multiples of 320 hours (NOTE 1)
* 1 1 1 value indicates that the timer is deactivated (NOTE 2).
*/
char psm_settings[] = CONFIG_LTE_PSM_REQ_RPTAU;
printk("PSM bits: %c%c%c\n", psm_settings[0], psm_settings[1],
      psm_settings[2]);
printk("PSM Interval: %c%c%c%c%c\n", psm_settings[3], psm_settings[4],
      psm_settings[5], psm_settings[6], psm_settings[7]);
int err = lte_lc_psm_req(true);
if (err < 0) {
printk("Error setting PSM: %d Errno: %d\n", err, errno);
}
}

 3. in main.c
void main(void)
{

        int ret;
        int err;
        static enum lte_lc_nw_reg_status status = LTE_LC_FUNC_MODE_POWER_OFF;

        handle_bsdlib_init_ret();

         ret = dk_leds_init();
if (ret) 
{
printk("LED init failed\n");
}

if (!IS_ENABLED(CONFIG_AT_HOST_LIBRARY)) {
/* Stop the UART RX for power consumption reasons */
NRF_UARTE0_NS->TASKS_STOPRX = 1;
}

              k_sleep(1 * 1000);
              setup_psm();
              k_sleep(2 * 1000);

               // Connect Cat-m1
          err = lte_lc_init_and_connect();
          if (err) {
             printk("LTE link could not be established.\n"); // wait LED lit for ever if we can't connect to the network
             while(1)
             {
                dk_set_led_on(0);
                dk_set_led_on(1);
              k_sleep(500);
             }
          }
// Flash LEDs to indicate good start.
            dk_set_led_on(0);
            dk_set_led_on(1);
            k_sleep(3 * 1000);
            dk_set_led_off(0);
            dk_set_led_off(1);

// Wait until we can measure the current
          while (1) {
          k_sleep(500);
          status = LTE_LC_FUNC_MODE_POWER_OFF;
          lte_lc_nw_reg_status_get(&status);

          /*
          if(status == LTE_LC_FUNC_MODE_POWER_OFF)
          {
            dk_set_led_off(0);
            dk_set_led_off(1);
          }
          else if(LTE_LC_FUNC_MODE_NORMAL == status)
          {
            dk_set_led_on(0);
            dk_set_led_on(1);
          }
          else if(LTE_LC_FUNC_MODE_OFFLINE == status)
          {
            dk_set_led_on(0);
            dk_set_led_off(1);
          }
          else if(LTE_LC_FUNC_MODE_OFFLINE_UICC_ON == status)
          {
            dk_set_led_off(0);
            dk_set_led_on(1);
          }
          else
          {
            dk_set_led_off(0);
            dk_set_led_off(1);
          }
*/
}
return 0;
}
Thanks in advance,
Parents
  • Hi!

    1. Is there any document available from Nordic that describes the exact steps to measure power consumption in PSM mode with the Dev Kit? Also, is there a test firmware available to test exactly this?

    I believe the blog you linked to is a document from Nordic describing exactly what you're looking for. The test firmware linked to in this post (and here) is not a sample available in NCS, which is why you can't find it. You will have to download the sample and add it to your NCS repo. 

    Best regards,

    Heidi

Reply
  • Hi!

    1. Is there any document available from Nordic that describes the exact steps to measure power consumption in PSM mode with the Dev Kit? Also, is there a test firmware available to test exactly this?

    I believe the blog you linked to is a document from Nordic describing exactly what you're looking for. The test firmware linked to in this post (and here) is not a sample available in NCS, which is why you can't find it. You will have to download the sample and add it to your NCS repo. 

    Best regards,

    Heidi

Children
No Data
Related