> -----Original Message----- > From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf > Of Richard Phillips > Sent: 12 December 2011 08:47 > To: Microcontroller discussion list - Public. > Subject: Re: [PIC] PIC16F690 not going to sleep/high current consumption >=20 >=20 > ----- Original Message ----- > From: Scott > Date: Fri, Dec 9, 2011 at 5:44 PM > Subject: Re: [PIC] PIC16F690 not going to sleep/high current consumption > To: "Microcontroller discussion list - Public." >=20 >=20 > 1. Have you looked at the generated assembly code to ensure that the > SLEEP instruction is present? >=20 > 2. Right after a SLEEP command, toggle an IO line. If you see it > toggle, you know SLEEP didn't work. >=20 > 3. Timer1 must be configured as an asynchronous counter (using an > external clock source). The internal oscillators are disabled, so they > cannot clock the Timers. I just ran into this in my last project. I > ended up using the WDT (which runs separately from the internal > oscillators) as my timer to wake from sleep. >=20 > 4. Any IO drawing current? Pullups enabled? >=20 > 1) The SLEEP instruction was present in the generated assembly code. > 2) The IO state changed when commanded after the SLEEP instruction, > leading me to believe either it didn't sleep, or woke up immediately. > 3) Yeah, I was afraid of that... that'll be an issue to resolve *after* I > get this one dealt with :) I may use an external LF xtal to address this. An external crystal will not help here, the sleep instruction switches off the oscillator. > 4) See below! >=20 > After further experimention I ripped out all of the external stuff I had > added on the demo board (aside from the 'default' LEDs, switch, pot) and: > - The PIC appears to be sleeping correctly - current much lower, > instructions not executed after sleep, sleep current identical on e.g. > 8MHz and 31KHz clock > - Current consumption is considerably lower, although not yet 'perfect' - > 0.76mA during sleep, 0.79mA during running @ 31KHz, 2.25mA during running > @ 8Mhz. The increase from sleep -> running current is roughly in line > with datasheet specs, although the base current of 0.76mA is still too > high. >=20 > As part of the testing, all ports were set to Output and all pullups > disabled in an attempt to minimise any current being drawn from IO ports. Do you have any external pull ups? I recently worked on a low power project where the PIC had external pull-ups on output pins, which were there to ensure the pins were held in the correct logic state whilst the micro was in reset. Initially I set the output pins high when putting the PIC to sleep, but this resulted in excessive sleep current since the external pull up (to Vdd) was sourcing some current INTO the PIC pin. Tri-stating the pin gave me the expected sleep current. Cheers Mike =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .