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

too high power consumption in sleep mode

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PIC16F917 sleep mode
Guest







too high power consumption in sleep mode
PostPosted: Mon Jul 16, 2007 3:20 pm     Reply with quote

Hi, I am experiencing the power consumption problem when PIC16F917 goes to sleep mode. Assume the circuit is correctly. How can I prepare a simple code which just runs to sleep and make it run on the lowest power consumption. Here's my code, but it shows too high of power consumption...

//#fuses NOWDT,INTRC_IO, NOPUT, NOPROTECT, NOMCLR, NOCPD, BROWNOUT, NOIESO, NOFCMEN, NODEBUG

void main()
{

while(TRUE)
{

set_tris_a(0x00);
set_tris_b(0x00);
set_tris_c(0xFF);
set_tris_d(0xFF);
set_tris_e(0xFF);

setup_comparator(NC_NC_NC_NC);

B_ANSEL=0x00;

SLEEP(); //Get in Sleep mode
}

}


I appreciate anyone can give any idea of it.

Thanks.

Bob
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Jul 16, 2007 3:40 pm     Reply with quote

What level of current do you measure in sleep mode ?

Also your #fuses statement is commented out. What are your
actual fuse settings ?

See these threads for ideas:
http://www.ccsinfo.com/forum/viewtopic.php?t=24562
http://www.ccsinfo.com/forum/viewtopic.php?t=23376
Bill Boucher



Joined: 04 Feb 2005
Posts: 34
Location: Chatham,ON,CA

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Tue Jul 17, 2007 10:32 am     Reply with quote

Also be aware that if your ANx pins are set to digital mode, don't leave them floating or the logical input buffers may draw excess current. Unused and unconnected pins can be forced to a valid high or low state by programming them as outputs. That will prevent floating so that no external pullup or pulldown resistors are needed. If you want to leave them floating (for some unknown reason) then program them as analog mode (that's the default mode I think) and the input buffers will be shut off and that will also prevent undue current draw.
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