Saving Power with the PIC16F1827

Discussion in 'General Electronics Chat' started by Guinness1759, Jan 6, 2011.

  1. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Hi,
    I'm looking for ways to save power using the PIC16F1827. My application requires very low power. I found this document http://ww1.microchip.com/downloads/en/DeviceDoc/01146B_chapter%202.pdf pretty helpful, but it doesn't prioritize them so I don't know which ones will reduce the power the most. Since I only have a limited amount of time to finish this project, what are the top 3 ways to reduce power? I only need to operate my circuit about every 20 seconds so what I'm thinking is to put my circuit into sleep or deep sleep for 20 seconds and wake it up using the watchdog timer. Would lowering the CPU speed save a lot of power? How would I do that?
     
  2. blueroomelectronics

    AAC Fanatic!

    Jul 22, 2007
    1,758
    98
    Firstly what's the power source and how long do you want it to run?
     
    Guinness1759 likes this.
  3. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Hi Bill,
    Basically I want the PIC to go into sleep for about 20 seconds, then wake up and execute code for less than a second and then go back into sleep mode for about 20 seconds and then execute the same code again for 1 second and so on and repeat forever. I'm using a 3V Battery as a power source.
     
  4. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    What amount of code would run for 1 second and at what clock speed?

    Usually, reducing the voltage and clock speed, while using sleep as much as possible results in low power usage. However, peripherals in the circuit may be drawing most of the power.

    For the 3V cell, do you mean a CR2032 coin cell or the large CR123A battery?

    What are the inputs and outputs of the circuit?
     
    Guinness1759 likes this.
  5. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Probably about 30-40 lines of code for 1 second at the most and the clock speed isn't important. For the 1 second of code I will need to use the serial peripheral and the ADC peripheral. I will be using something similar to a CR123A battery.
     
  6. Spence

    Member

    Apr 23, 2010
    49
    3
    search for "microcontroller tips and tricks.pdf" on the microchip website, it's got a whole section on power saving techniques.
     
    Guinness1759 likes this.
  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Will the output go to a MAX232 IC or similar? That would draw more power then the uC itself, and should be shutdown between uses, as shown in the document you linked in the first post.

    Your question on "Which Helps More?" is essentially lower voltage, which you have, lower the clock speed, which is limited by the serial speed you intend to use, and using sleep as often as possible. Those would all be for nothing if an RS232 driver was being run on the same battery full time, though.
     
    Guinness1759 likes this.
  8. Guinness1759

    Thread Starter Member

    Dec 10, 2010
    64
    0
    Actually I'll be driving an external transmitter with a baud of about 9600. What register should I set to change the clock speed? Will that affect other registers such as the WDTPS, because I have the watchdog set to 16 seconds for interrupt.
     
  9. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    The details are in the link you posted above. If you change the clock speed, you'll want to change the prescaler on the WDT to timeout at 16 seconds. Switching from 20Mhz to 4Mhz is even a boost to power saving, using the internal oscillator is better than using a crystal, though I'm not sure how 'exact' the 16 second interval needs to be in your case.
     
    Guinness1759 likes this.
Loading...