View previous topic :: View next topic |
Author |
Message |
johnpclaude
Joined: 07 May 2004 Posts: 3
|
How to get into low power mode |
Posted: Mon Nov 08, 2004 11:44 pm |
|
|
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! |
|
![](templates/subSilver/images/spacer.gif) |
ckielstra
Joined: 18 Mar 2004 Posts: 3680 Location: The Netherlands
|
|
Posted: Tue Nov 09, 2004 3:55 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah Guest
|
|
Posted: Tue Nov 09, 2004 4:21 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|