Power Efficient Software Coding

后端 未结 17 606
北海茫月
北海茫月 2020-12-23 16:19

In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software progra

相关标签:
17条回答
  • 2020-12-23 17:04

    Consider using the network interfaces the least you can. You might want to gather information and send it out in bursts instead of constantly send it.

    0 讨论(0)
  • 2020-12-23 17:04

    also something that is not trivial to do is reduce precision of the mathematical operations, go for the smallest dataset available and if available by your development environment pack data and aggregate operations.

    knuth books could give you all the variant of specific algorithms you need to save memory or cpu, or going with reduced precision minimizing the rounding errors

    also, spent some time checking for all the embedded device api - for example most symbian phones could do audio encoding via a specialized hardware

    0 讨论(0)
  • 2020-12-23 17:09

    Rather timely this, article on Hackaday today about measuring power consumption of various commands: Hackaday: the-effect-of-code-on-power-consumption

    Aside from that:
    - Interrupts are your friends
    - Polling / wait() aren't your friends
    - Do as little as possible
    - make your code as small/efficient as possible
    - Turn off as many modules, pins, peripherals as possible in the micro
    - Run as slowly as possible
    - If the micro has settings for pin drive strengh, slew rate, etc. check them & configure them, the defaults are often full power / max speed.
    - returning to the article above, go back and measure the power & see if you can drop it by altering things.

    0 讨论(0)
  • 2020-12-23 17:10

    Simply put, do as little as possible.

    0 讨论(0)
  • 2020-12-23 17:12

    Choose efficient algorithms that are quick and have small basic blocks and minimal memory accesses.

    Understand the cache size and functional units of your processor.

    Don't access memory. Don't use objects or garbage collection or any other high level constructs if they expands your working code or data set outside the available cache. If you know the cache size and associativity, lay out the entire working data set you will need in low power mode and fit it all into the dcache (forget some of the "proper" coding practices that scatter the data around in separate objects or data structures if that causes cache trashing). Same with all the subroutines. Put your working code set all in one module if necessary to stripe it all in the icache. If the processor has multiple levels of cache, try to fit in the lowest level of instruction or data cache possible. Don't use floating point unit or any other instructions that may power up any other optional functional units unless you can make a good case that use of these instructions significantly shortens the time that the CPU is out of sleep mode.

    etc.

    0 讨论(0)
  • 2020-12-23 17:13

    Don't poll, sleep

    Avoid using power hungry areas of the chip when possible. For example multipliers are power hungry, if you can shift and add you can save some Joules (as long as you don't do so much shifting and adding that actually the multiplier is a win!)

    If you are really serious,l get a power-aware debugger, which can correlate power usage with your source code. Like this

    0 讨论(0)
提交回复
热议问题