----- Original Message -----=20 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." 1. Have you looked at the generated assembly code to ensure that the SLEEP instruction is present? 2. Right after a SLEEP command, toggle an IO line. If you see it toggle, you know SLEEP didn't work. 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. 4. Any IO drawing current? Pullups enabled? 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 g= et this one dealt with :) I may use an external LF xtal to address this. 4) See below! After further experimention I ripped out all of the external stuff I had ad= ded on the demo board (aside from the 'default' LEDs, switch, pot) and: - The PIC appears to be sleeping correctly - current much lower, instructio= ns 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 d= atasheet specs, although the base current of 0.76mA is still too high. As part of the testing, all ports were set to Output and all pullups disabl= ed in an attempt to minimise any current being drawn from IO ports. Today i'll look at cutting the tracks for the onboard LEDs, switch and pot = to ensure that they are not erroneously drawing current and see if this imp= roves the situation further. Richard --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .