BrianT
- 5th February 2008, 09:38
I have a data logger with a DS1626 RTC and thermometer, a PIC18LF4620, dual M25P64 flash memory chips for 16 MBytes storage and some analog peripherals for acceleration, pressure, light levels, etc. Everything runs on a 3.7 volt lithium cell.
I need to run at lowest possible power for maximum battery lifetime. I need to wake the product up every ten minutes or so to take the next readings. I also need to monitor the battery voltage and shut the product down permanently when the battery goes low to prevent code scrambling. Experience shows the PIC18LF4620 will totally scramble the code space when the battery goes flat.
Here is what I have found.
If I set BOREN then the product draws about 40 uA when asleep - way too much. It looks like the brown out detector draws about 32 uA. If I clear BOREN the current drops to about 5 uA. Will the HLVD approach draw any less current than the Brown Out Detector?
I set the WDT OFF in hardware and enable it with software (SBOREN = 1). The WDT draws about 2 uA it seems. If the WDT is OFF the PBP SLEEP command never recovers.
If I clear the OSCON.7 bit = 0, making IDLEN = SLEEP, the book says I can get down to about 100 nA current draw. If I do that however, all the peripherals are then OFF and I can't see how the PBP SLEEP command can work. The code will run once and never recovers from the SLEEP command.
Am I right in assuming that the lowest power will come from clearing IDLEN and then I must rely on an external interrupt to portb.o to recover from sleep. It seems to be a bit self defeating if I need extra hardware to kick the PIC in the goolies to wake it up.
The lowest current I an repeatably and reliably get down to is a sleep of 3.5 uA with a run current around 5 mA which is largely set by the external hardware.
Any tips on getting this 'nanowatt' technology to actually work at the nanowatt level will be gratefully appreciated. I have read at least some of the App Notes on nanowatt but they do not go past the obvious such as powering down attached hardware.
Cheers
BrianT
I need to run at lowest possible power for maximum battery lifetime. I need to wake the product up every ten minutes or so to take the next readings. I also need to monitor the battery voltage and shut the product down permanently when the battery goes low to prevent code scrambling. Experience shows the PIC18LF4620 will totally scramble the code space when the battery goes flat.
Here is what I have found.
If I set BOREN then the product draws about 40 uA when asleep - way too much. It looks like the brown out detector draws about 32 uA. If I clear BOREN the current drops to about 5 uA. Will the HLVD approach draw any less current than the Brown Out Detector?
I set the WDT OFF in hardware and enable it with software (SBOREN = 1). The WDT draws about 2 uA it seems. If the WDT is OFF the PBP SLEEP command never recovers.
If I clear the OSCON.7 bit = 0, making IDLEN = SLEEP, the book says I can get down to about 100 nA current draw. If I do that however, all the peripherals are then OFF and I can't see how the PBP SLEEP command can work. The code will run once and never recovers from the SLEEP command.
Am I right in assuming that the lowest power will come from clearing IDLEN and then I must rely on an external interrupt to portb.o to recover from sleep. It seems to be a bit self defeating if I need extra hardware to kick the PIC in the goolies to wake it up.
The lowest current I an repeatably and reliably get down to is a sleep of 3.5 uA with a run current around 5 mA which is largely set by the external hardware.
Any tips on getting this 'nanowatt' technology to actually work at the nanowatt level will be gratefully appreciated. I have read at least some of the App Notes on nanowatt but they do not go past the obvious such as powering down attached hardware.
Cheers
BrianT