This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

LCP932 Power Consumption

Hi, I have a delay function that for some reason every time I included in my project it causes the micro controller to use extra power. With out the function I read 20 micro amps in total power down mode, but with the function I read 4.4 miliamps in the same mode. I use this delay function to energize a relay for about 50 miliseconds. Is there any other method I could use to replace this function with? Or even better, why is this function "I assume" causing the micro to concume so much power.
Thanks.

void delay (int x) small reentrant { //0 to 4,294,967,295
int i;

for (i = 0; i < x; i++) { ;
}
}

Parents
  • I think we'll have to dissect your wording a little to clear up a few things here.

    *) You write the current consumption goes as you include the routine into the code --- I strongly suspect that's not what actually happens. No matter what the function does, it'll only act if you actually call it, and then only while it's actually running.

    *) You refer to total power down mode for your current measurements --- that doesn't make sense. While that delay() function is running, you cannot possibly be in total power down mode, so you're comparing apples with oranges.

    *) The canonical method of achieving longer pauses without burning energy the way you're currently doing it is to use the timer --- that's why your micro has timers, essentially.

Reply
  • I think we'll have to dissect your wording a little to clear up a few things here.

    *) You write the current consumption goes as you include the routine into the code --- I strongly suspect that's not what actually happens. No matter what the function does, it'll only act if you actually call it, and then only while it's actually running.

    *) You refer to total power down mode for your current measurements --- that doesn't make sense. While that delay() function is running, you cannot possibly be in total power down mode, so you're comparing apples with oranges.

    *) The canonical method of achieving longer pauses without burning energy the way you're currently doing it is to use the timer --- that's why your micro has timers, essentially.

Children