On 22/12/2010 19:32, Bob Blick wrote: > On Wed, 22 Dec 2010 17:55:30 +0000 (UTC), zipwize said: >> Recently I had to get sleep mode to work for the PIC16F688. I have MCLR >> set as internal. I'm using the internal RC oscillator. I have two output= s >> going to transistors to drive LED's. I have two switch inputs with pull >> up resistors. I'm running the device from 3 type 675 coin batteries. I >> had so much trouble getting the current down. I was getting hundreds of >> uA. It would float all over the place from 1.2mA to 100uA. Finally I >> discovered that if I connect about 5K I could get the sleep mode current >> down to 70nA. It was consistant. I'm using wake up on pin change and I >> only have the two switch inputs enabled. I set all the other pins as >> input. I have nothing else connected. I use ICSP with a ICD-3. I fixture >> the tiny board with probes to connect the ICSP pins. >> >> If MCLR is internal, why do I have to tie it low to get low sleep >> current? Is there a better way? > You need to set unused pins as outputs or else tie them to + or ground. > You can use internal pullups, floating inputs draw current. However I > don't think MCLR has one on the '688 so it definitely must be tied > somewhere. > > Bob has it pretty much covered here. Generally the data sheet provides the info required for minimising=20 current during sleep, always worth reading for different PICs (current consumption may be different depending on sleep=20 modes/peripherals etc) Section 11.8 of the 16F688 data sheet says: For lowest current consumption in this mode, all I/O pins should be either at VDD or VSS, with no external circuitry drawing current from the I/O pin, and the comparators and CVREF should be disabled. I/O pins that are high-impedance inputs should be pulled high or low externally to avoid switching currents caused by floating inputs. The T0CKI input should also be at VDD or VSS for lowest current consumption. The contribution from on-chip pull-ups on PORTA should be considered. The MCLR pin must be at a logic high level. --=20 http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist .