Electronic – How to find energy leaks

debugginglow-poweroperating system

I'm in a process of writing software for eZ 430 Chronos watch using TinyOS. I want it to be as low-power as it is possible.

Unfortunately, my measurements show power consumption of about 350uA @3.3V on a simple idle program which does nothing, but turn all sensors off, enable external oscillator and go into the LPM4 mode. This value is bigger than the two external sensors can eat.

The original Texas Instruments software (which I've read and found nothing I could forgot to set) consumes about 9uA when idle.

Are there any methods for debugging energy leaks? How should I proceed when checking my code (and TinyOS) didn't reveal any problem?

I measure power consumption using an oscilloscope and an amplifier similar to Dave Jones' uCurrent. I've tested this set on a set of resistors and got correct readings.

The schematics for eZ430 watch are here, on the page 79.

Best Answer

The problem was with our clocks support in TinyOS, which leaved TA1CTL with continous mode bit set and prevented to enter sleep mode lower than LPM1.

From this problem I can learn some lessons for the future:

  • Proper measurement is crucial in debugging such problems. Oscilloscope with a micro current meter was very helpful.
  • Read your datasheets carefully. Knowing what is the power consumption of every device in every mode allows you to match the measured value to the device.
  • Calculate, in which sleep mode you really are. You probably have a sleep mode calculation code somewhere in your program. Print its result somewhere if you can.
  • The rest is the process of elimination. Either negative - comment or disable parts of code and check if the power consumption changes, or positive - get a piece of example software from the chip vendor and add its code by chunks to your program to check if you didn't forgot to initialize something.
Related Topic