CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

PIC16F88 Current Consuption in Sleep mode

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
eleqtc



Joined: 20 Jan 2004
Posts: 5

View user's profile Send private message

PIC16F88 Current Consuption in Sleep mode
PostPosted: Wed Jan 21, 2004 12:26 pm     Reply with quote

Hi,

Have a PIC16F88 in a 72mS WDT sleep loop, A/D disabled, Timer1 disabled, INT_RC osc at 2MHz, Port A set to O/P all at low state with no external connections except for RA3 A/D i/p (set to i/p) tied low via resistor. Port B set to output and high state with no connections to external devices. I'm reading 70uA operating current with 3 volt operation. WDT only takes a few uA according to datasheet so can I get it lower than 70uA ? What's taking all these microamps?

Thanks,
Tony

Just tried osc set to 1MHz , current down to 63uA. Still not good enough.
It would suggest something is enabled ..........somewhere
Neutone



Joined: 08 Sep 2003
Posts: 839
Location: Houston

View user's profile Send private message

PostPosted: Wed Jan 21, 2004 1:22 pm     Reply with quote

And how much current while the WDT is disabled and it is in sleep mode?
Guest








PostPosted: Wed Jan 21, 2004 1:23 pm     Reply with quote

Post your #fuses statement, and also post all peripherals that you use.
(I want to see if you have Brownout enabled, or the comparator,
or Vref, etc.) With regard to external connections, what circuit do
you have on the MCLR pin ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Jan 21, 2004 1:24 pm     Reply with quote

That post above was from me. Somehow, I got logged in as Guest.
I fixed that.
Guest








PostPosted: Wed Jan 21, 2004 3:05 pm     Reply with quote

How bizzare. The reason I'm trying to get a lower consumption is that I got about 17uA with a PIC16LF84 in sleep mode.



// compiled with PCWH version 3.180


#include <16F88.H>
#fuses MCLR, NOBROWNOUT, NOLVP, WDT, NOCPD, NOPROTECT, INTRC_IO, PUT, NODEBUG
#device adc=8
#use fast_io(A)
#use fast_io(B)
#use delay(clock=2000000)

// rem'd out these two lines, no change.
#use rs232(baud=9600, rcv=PIN_B2,xmit=PIN_B5, parity=N, bits=8, errors, restart_wdt )
#use I2C(master, sda=PIN_B1, scl=PIN_B4, fast)

#byte adcon0 = 0x1f

/* As you can see I'm using RS232 and I2C but have commented out any such routines to try to
see what's going on. This is the only code compiled.

*/


main() {

setup_oscillator(OSC_2MHZ | OSC_INTRC);

disable_interrupts(GLOBAL);

setup_wdt(WDT_72MS) ;

set_tris_a(0x00); // RA4 for A/D input
porta = 0x00 ;

set_tris_b(0x00) ;
portb = 0xff ;

// Nothing physically connected to any port pins


adcon0 = 0x20 ; // turn adc off


port_b_pullups(true); // true or false, no difference to current consuption
setup_timer_1 ( T1_DISABLED );

while(true) {
// no difference with or without these two lines.
output_low(CS_DIGPOT); // like to see a pulse to measure actual WDT time.

//delay_ms(1); // did have this in to see pulse better on oscilloscope

output_high(CS_DIGPOT);
sleep();

} // end while loop

} // end main
eleqtc



Joined: 20 Jan 2004
Posts: 5

View user's profile Send private message

16F88 Slep current
PostPosted: Wed Jan 21, 2004 3:11 pm     Reply with quote

Yes I managed to post my code as Guest.
I forgot the reset circuit. It's the standard R-C as per the datasheet.

Tony
eleqtc



Joined: 20 Jan 2004
Posts: 5

View user's profile Send private message

Problem solved
PostPosted: Wed Jan 21, 2004 6:01 pm     Reply with quote

It's the internal oscillator. Clock switching now gives me 3.4uA if I don't wait for a stable oscillator. That matches the datasheet info for the WDT with my 3 volt supply.

If I do wait as in the code below I have to wait just over 4mS for stability with an average current of 16uA drawn.

I wish it only took me 4mS to wake up properly each morning !

Regards,
Tony

while(true) {

setup_oscillator(OSC_31kHZ | OSC_INTRC);
sleep();
setup_oscillator(OSC_2MHZ | OSC_INTRC);

output_low(pin_b3); // see time overhead
IOFS=false;
while(!IOFS) {}
output_high(pin_b3);

}
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group