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

Power Optimization in HID Keyboard Example

  • Custom Board with MCU NordicSemi nRF51822-QFAA

  • Softdevice S110 7.1

  • IAR for ARM 7.1

  • SDK 7.2 using a merged service (HID keyboard example + NUS example + HRS example)

  • Testing with iPhone 5S, 6 and iPad air (iOS 8.1.3)

    / Nexus 5 and Galaxy Note 3 (Android 4.4.2).

/****************************************************************************/

image description

In this webpage, it is written "This application is not power optimized!".

I thought the power_manage() function does the job at first.

So my questions are,

  1. Does power_manage function changes the MCU's power mode if an event (or interrupt)

occurs? Also, if there is no event, does the MCU falls into other power modes? (like sleep mode)

  1. Since this application isn't power optimized, which code should be edited?

Do I have to change the SDK in order to achieve less power consumption?

/**************************/

Edited 12.Mar.2015 : I was trying the compiler optimization. Your linked showed the way

when the tool is Keil. Since I'm using IAR for ARM, what should I change?

image description

/**************************/

Edited 15.Mar.2015 : Thanks for the thread you provided.

I tried the compiler optimization as you informed.

Observing with Monsoon Power Monitor to check the current consumption,

the current consumption did decreased a little.

Code Size

Does the current decreasing effect when using compiler optimization has relationship with

the size of the code?

Release Mode

Or does it has relationship when I use debug mode or release mode?

-Regards, Mango922

Parents
  • Hi

    I would like to point you to this thread which is the current consumption guide for the nRF51

    1. See section "Low power mode with BLE softdevice" in the linked thread.
    2. Typically, when the examples are marked as "not power optimized", they are only lacking the compiler optimization needed for optimized power saving. See the "Compiler optimization" section in the linked thread to enable compiler optimization.

    Update 12.3.2015 To optimize the code for minimal current consumption, you would need to optimize the code for speed. For that purpose, choose "high" level of optimization and select all the optimization options on the right hand side. Also choose "Speed" and "No size constraints" if you think have enough available ROM for your application on the nRF51. Choose "Multi-file Compilation" in order to apply your optimization settings to all your project files.

    When optimizing, it is a tradeoff if you wish to optimize for speed or size. If there are no ROM size constraints for your application, i.e. the size of the application is relatively small, then you can fully optimize for speed, which will make the CPU execute as few instructions as possible to carry out the desired functionality in your code, which will save power.

    image description

Reply
  • Hi

    I would like to point you to this thread which is the current consumption guide for the nRF51

    1. See section "Low power mode with BLE softdevice" in the linked thread.
    2. Typically, when the examples are marked as "not power optimized", they are only lacking the compiler optimization needed for optimized power saving. See the "Compiler optimization" section in the linked thread to enable compiler optimization.

    Update 12.3.2015 To optimize the code for minimal current consumption, you would need to optimize the code for speed. For that purpose, choose "high" level of optimization and select all the optimization options on the right hand side. Also choose "Speed" and "No size constraints" if you think have enough available ROM for your application on the nRF51. Choose "Multi-file Compilation" in order to apply your optimization settings to all your project files.

    When optimizing, it is a tradeoff if you wish to optimize for speed or size. If there are no ROM size constraints for your application, i.e. the size of the application is relatively small, then you can fully optimize for speed, which will make the CPU execute as few instructions as possible to carry out the desired functionality in your code, which will save power.

    image description

Children
No Data
Related