Electrical – sleep mode in pic16f1618/19

mplabpicpic16fsleep

I am trying to reduce the power consumed by microcontroller pic16f1618, and hence I thought of using SLEEP(). All interrupts such as timer, and pin are disabled. The code is generated with the help of MCC(code configurator). The function call to timer and pin initialization is commented. Microcontroller is running at 16MHz. I am measuring the current consumed by microcontroller under two circumstances.

  1. There is just a main() function after system initialization, there is a code to read a pin inside main(). – current consumed is 8.4mA
  2. There is SLEEP() after reading the pin in main(). – current consumed is 6.6mA

The pic16f1618 is powered through a battery management chip, bq40z60. Multimeter is placed between the voltage source of 12V and the battery chip input voltage. Hence the current measured is a total of current consumed by battery chip and pic16f1618. BQ40z60 consumes a maximum of 1.8mA.

Even though there is reduction in current consumption, it is not significant. The data sheet documents in nA. Considering the pins are not inputs, the current consumption should at least be in uA. Is there anything I need to look into?

Best Answer

Almost certainly one or more of your I/O pins are sourcing current. The pin drivers are still on during sleep. If you want the pins to be high impedance during sleep, you have to explicitly set them that way.

Put the processor to sleep and look at all the pin voltages. For any that are high, examine the circuit carefully to see if keeping that line high requires current.

Some peripherals continue to draw power during sleep. For the lowest power consumption, make sure things like the watchdog timer, brownout detect, and the like are off. However, 6.6 mA is a lot for a few peripherals on during sleep. The real problem is pins set high sourcing current, as described above.