Electronic – PIC: Debug power consumption issues

picpower

I have a board containing a PIC16 (see datasheet here) that is drawing too much current. We're able to measure the current draw for the board as a whole, but we can't measure the current draw for every single component.

Our theoretical calculations put the current draw at 300uA, but we are seeing a 500uA. To debug for this 200uA overshoot, we want to put the PIC in it's lowest possible current mode. How can the PIC be put in it's lowest power mode?

What I have done is disable all the flags (such as brown-out reset, stack overflow/underflow reset, etc.) and put the PIC to sleep at the first instruction. Should I put the PIO pins in a specific state? Are there peripherals that are enabled by default and should be turned off?

Best Answer

Make sure all peripherals are off, the watchdog and brownout are off, and the processor is asleep. That should minimize current draw of the PIC itself. Make sure all digital input pins are driven solidly high or low, and make sure all output pins are set so that they don't cause current in the rest of the system.

The stack overflow/underflow reset has nothing to do with power drain. It's just part of the digital logic of the processor. Turning off the processor clock (putting the device to sleep) will turn that off along with the rest of the processor logic.

Some subsystems are independent of the processor clock and need to be turned off separately. Examples include the watchdog timer and the brownout reset detect. The A/D can also be on if running from its internal R-C clock. The datasheet shows the incremental current drawn for all these things. Go thru that list and make sure everything is off.

You say you can't meausure current of individual components, but of course you can. You could even remove the PIC from the board and wire all its outputs high or low, then see what the board takes. That completely removes the PIC from the equation. Or you could do the reverse. Put the PIC on a breadboard by itself running the same code that should shut it down, and measure its current then.