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

How to get into low power mode

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



Joined: 07 May 2004
Posts: 3

View user's profile Send private message

How to get into low power mode
PostPosted: Mon Nov 08, 2004 11:44 pm     Reply with quote

I am using a PIC18F2320 in a +3V battery operated circuit. The circuit has a switch array that is driven by portB. I enable the portB pullups. The other side of the switches are ganged to portB.0 so that a closure wakes up the PIC. I am using the ADC to measure a battery voltage. I have pull up or pulldown resistors on all other pins including 9 and 10 (am using the internal RC osc.). When I go to sleep mode, I set the I/O pins to high or low (as required to shutdown other devices) so that there is no voltage drop across them at sleep time. I turn off the ADC. When all is done, I am still drawing about 90 microamps at +3V. I have verified that no other circuits are drawing power. What else in the PIC is still drawing power?

Please note that at one point while degugging the problem I was able to get down to 0.3 microvolts. But that happened when I commented out the setup_adc() function in the beginning of my main(). But that caused the lower nibble of the portB pullups to turn off! Please help!
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Tue Nov 09, 2004 3:55 am     Reply with quote

Without schematics of your circuit it is difficult to give an answer. You say that that you 'have verified that no other circuits are drawing power', but apparently you are overlooking something. Things that come to mind for checking are:
- Floating input pins (can start oscillating and draw a lot of curent).
- Check your watchdog is disabled (NOWDT fuse).
- There are several sleep modes. Which one are you using? How are you selecting this?
- If you selected any idle mode instead of sleep mode, your on-chip peripherals are still running, for example the R/C oscillator for the A/D-converter is one that is easily overlooked.
Ttelmah
Guest







PostPosted: Tue Nov 09, 2004 4:21 am     Reply with quote

Obvious further comment, given the effect of the pullups, is 'what is attached to PORTB, and which way are you driving these pins?. Remember if PORTB pullups are enabled, you need to drive the pins high if these are not going to draw current, and if they are driven high, what effect does this have on the external devices?.

Best Wishes
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