PDA

View Full Version : PIC10F206 - What is the LOWEST Power @ Rest or Sleep



rixtalbert
- 26th February 2007, 13:09
I have been experimenting with my 10F206's for months now, and I am measuring the differences in Sleep mode using Pic Basic Pro.
The PBP manual states that the END statement is just a cycle of SLEEP commands. Since SLEEP and NAP commands use the WatchDog timer, WDT must be turned on. for any of the three commands to work properly or at all.
When the END command is reached in the program, the PIC does go down to about 1.9 to 2,1 u Amps. That doesn't seem to bad.
I am using a NEW Fluke 189 Data logger meter to measure the current in sleep. When I Select the MAX/MIN button on the meter, ( FAST RECORD), the PIC records a pulse of current to about 87.2 u Amps about every three seconds or so.
THE QUESTION---------
Is there any way to completely turn off the WDT from waking up and drawing that current to stay at the 2.0 uAmp range or less?
I was wanting to use a bunch of NAP statements in my program also just to save some power while doing stuff and then Completely turn off all power till a new Power UP. My design does not need to wake up until a new power supply is applied.

Thanks All


Thanks

RIX

Jerson
- 26th February 2007, 13:15
A simple statement like this will do exactly what you want

This is inline assember

turn off all interrupts here
@ sleep
goto main ' on wake up


Jerson

rixtalbert
- 26th February 2007, 14:54
Thanks Jerson,

I had tried that, and I still get a blip of 87.5 uAmps about every three seconds. I guess I need a more expensive meter to see exactly what the transistion times are between 1.6 uAMp and the high pulse current of 85 uAmps. I thought I had read somewhere that the WDT will keep waking up to check things out and go back to sleep. I just cannot find out if you actually can KILL the WDT after a END of program is hit.
Also I thought that the @SLEEP ,,,, ASM command still had to have the Watchdog timer running to function.

I'll keep digging.

Regards
Rix

sougata
- 26th February 2007, 16:33
Hi,

If you like your PIC to go to a dead sleep then the WDT needs to be turned off. Use your config settings to turn it off and also use:



DEFINE NO CLRWDT 1


This prevent PBP from inserting code to clear the WDT periodically in other words saves code space.

rixtalbert
- 27th February 2007, 00:41
Sougata,
I think that is and excellent command if it would only work after all of my other naps through my program.

In the battery world as you know, I am trying to squeese every bit of power from the battery as I can.
The naps instead of PBP pause commands give me that better edge.
But when it come to the end of the program, (runs for about a minute and a half to three minutes) I want to put the program on a deep sleep until the power is cycled. That is my problem.
I cannot get to deep sleep (lowest power possible) without enabling the WDT.

I had thought that there may be a POR id Power on Reset that would take out the WDT and let the chip go frozen with 2 uAmp or lower if the power supply was still connected without the WDT waking up and looking for who needed help and going back to the 2uAmp state.

I did complete a logging session with my Fluke 189 and I did see currents as high as 127 uAmp while it was suppose to be very rested. I have sent an email to FLUKE to ask why I could not log the FAST min/MAX on the software as I do on the 189 Display.

For my Application, I wish PBP could find a way to completely KILL the WDT at the end with a NEW "KILL" statement. I don't know if that would make other people happy, but it would seem to come in handy for BATTERY apps.
I bet Jeff or Bruce could come up with a ASM command that could "KILL" future WDT timer routines. (PBP Kill command)

Thanks to All
Regards
Rix

sougata
- 27th February 2007, 05:05
I cannot get to deep sleep (lowest power possible) without enabling the WDT.


Hi,

Please note that you need not use the PBP sleep command. With your watch dog turned off from the configuration bits you can put the micro to sleep via its direct asm instruction "SLEEP". Jerson showed you a way to do that in ASM. Only keep in mind that a comparator interrupt or pin change interupt can wake it up again. Already mentioned by jerson. Turn them off.

Archangel
- 27th February 2007, 06:14
Hi rixtalbert,
If I understand this correctly ( I probably do not ) you want to shut the pic completely off when the program finishes executing until you power it up again with a switch? Why not feed the pic power through a small SCR and series resistor, you could then wire an output pin to the hot side of the resistor. Your program would then only need to output high on that pin to cause the SCR to cutoff.<b> I have not wired this up to test, so I do not know if the back voltage into the output will fry the pic or if it will simply drop out when the pic powers down.</b>
JS

sougata
- 27th February 2007, 07:52
Hi Joe,

It is a nice idea. Once fired when the PIC enters the SLEEP it will probably delatch due to current less than the minimum latching current. But I personally feel it is not necessary as it adds to the hardware cost and also causes power loss (disipation). Not recommended for a battery powered low (ultra???) current equipment. With the 10F206 it is possible to shut it off into ultra low power mode by software only without any modification to the existing circuit and PCB.

Rixtalbert I hope by this time you have already implemented what jerson suggested. If not then post your code or usage of the peripherals --> Interrupts, Pin Change, Comparator etc so that an actual code snippet can be thrown.

rixtalbert
- 28th February 2007, 00:33
Right off!~

Thanks to all the guys that have commented on this issue of mine.

I have attached a crude code with current readings during the time of the events as best I could to help sort out the problem.

I am still speaking with Fluke on model 189 issues to understand why their Forms View software does not record the same readings as the the 189 meter display. That is a different problem.
Honestly, the new Fluke 189 was probably not meant to record such low uA readings with much accuracy.
But I do see around 2uA at the END statement with peaks every few seconds to around 89 uA.(These 89uA current peaks are what I want to kill)

I have tried all of the suggestions in my brainless code snippet to see where the edge is of current draw...

It is funny that the NAP to NAP transistion seems to draw around 400 + uA current. OOOOOHHHH well.

And also the END statement without turning on the (WDT fuse ),in the settings Just locks a 10F206 where it cannot be restarted after power is removed and reconnected. It is a one time program run. After that ,, No more running after re=power UP.

Thanks again Guys...
and I will keep reading the fine line.

I did find a nice post in the Proton section that had problems with a PIC not wanting to sleep. I had the link and it vaporized in my network before I could paste it..


Regards for your advice
Rix

skimask
- 28th February 2007, 00:50
I am still speaking with Fluke on model 189 issues to understand why their Forms View software does not record the same readings as the the 189 meter display. That is a different problem.
Honestly, the new Fluke 189 was probably not meant to record such low uA readings with much accuracy.
Rix

http://assets.fluke.com/datasheets/2153ExtSpecs.pdf

I just had a look at the '189's spec's on their site. They say it's good for .25% + 20 counts measuring DC, higher than that if AC. But, they also state that's only if the meter has been cal'd in the last year. Short answer from me anyways...it should be able to measure those currents without a problem...

Not sure about the other problems. I didn't see anything in the errata that caught my eye. I'd be inclined to think that your problem lie elsewhere, the power grid, something else in the room, static charge, something... I don't know enough about what you've got going on.

(Ya know, using a power switch doesn't draw much current :) I kid...I kid...)

rixtalbert
- 1st March 2007, 00:49
Well , I know this is getting off the original topic, but I may as well Identify the Fluke Problems or limits.
Speaking with a Fluke engineer this morning. He stated that the Fluke 189 , Mine is four Months old, ,,, that the meter itself is logging 4 samples per second. Not Much but still enough to catch the 10F206 wakeing up to do something, WDT whatever. Normal Sleep has been a nice 1.9 uAmp sleep.
Then the 88. to 129uAmp capture while waking from sleep every few seconds or so. He stated that these measurments should be very close to the spec posted on the meter.
The problem with the Fluke Forms Logging software is that it polls the meter directly once every second and gets its own readings. NOT WHAT may have been in a memory address of the meter. So I told the engineer that i left the test run for about five hours while the PIC was in sleep and wakeing up. You would think that I could have at least captured one high 88uAmp reading from the Fluke Forms software in that time. NO WAY. He didn't really comment on this question or situation.



So, I conclude that the Fluke software used for this purpose is OUT. The meter is still great on it's own for the other logging that it can do by itself.
My comment to FIX the Problem "Since the Fluke 189 knows that the meter is being recorded vai a PC and their Fluke Forms software, U would think that, In that Once every second, the sofware would have it's own storage area to say, Hey, I saw that pic wake up the last one second that I polled you. Thanks 189 meter and reset after I get the data to the Fluke Forms Software, Then record the next set , and I'' get back to you in a second.... OK,,,,,,,," It might miss a few peaks and valleys while doing all that chatting but might get lucky and catch some valid data. The WDT is as much a chatter box as me..

I guesss I need a $20,000 dollar meter to read a 45 cent PIC, with a 2 cent program register error thanks to me.

Life is Good,

I wish I could add the Switch, as suggested, it is a sure fire way, but I have not been certified for diving below 500 feet deep. ( That is where the Pic is).

I had really thought I missed something, or just didn't know something in the PBP software that would allow me to shut down the chip in software. ( Thats how this thread got started)

PS...Good News,, I have found one way to put the pick to sleep without a switch or software,,,,,,,,,,,,,,,,,,,,,,,Just one piece of Hardware with no moving parts..............












I always wondered why I kept this Claw Hammer in my office and not in my garage. It works great... but same problem as turning WDT off... It will not restart again on re-powerUP..


back to the drawingboard or in this case,,, Skate board.

Regards Guys,,

Rix

skimask
- 1st March 2007, 01:01
Well , I know this is getting off the original topic, but I may as well Identify the Fluke Problems or limits. Speaking with a Fluke engineer this morning. He stated that the Fluke 189 , Mine is four Months old, ,,, that the meter itself is logging 4 samples per second. Not Much but still enough to catch the 10F206 wakeing up to do something, WDT whatever. Normal Sleep has been a nice 1.9 uAmp sleep. Then the 88. to 129uAmp capture while waking from sleep every few seconds or so. He stated that these measurments should be very close to the spec posted on the meter.
The problem with the Fluke Forms Logging software is that it polls the meter directly once every second and gets its own readings. NOT WHAT may have been in a memory address of the meter. So I told the engineer that i left the test run for about five hours while the PIC was in sleep and wakeing up. You would think that I could have at least captured one high 88uAmp reading from the Fluke Forms software in that time. NO WAY. He didn't really comment on this question or situation. So, I conclude that the Fluke software used for this purpose is OUT. The meter is still great on it's own for the other logging that it can do by itself. My comment to FIX the Problem "Since the Fluke 189 knows that the meter is being recorded vai a PC and their Fluke Forms software, U would think that, In that Once every second, the sofware would have it's own storage area to say, Hey, I saw that pic wake up the last one second that I polled you. Thanks 189 meter and reset after I get the data to the Fluke Forms Software, Then record the next set , and I'' get back to you in a second.... OK,,,,,,,," It might miss a few peaks and valleys while doing all that chatting but might get lucky and catch some valid data. The WDT is as much a chatter box as me.. I guesss I need a $20,000 dollar meter to read a 45 cent PIC, with a 2 cent program register error thanks to me. Life is Good, I wish I could add the Switch, as suggested, it is a sure fire way, but I have not been certified for diving below 500 feet deep. ( That is where the Pic is). I had really thought I missed something, or just didn't know something in the PBP software that would allow me to shut down the chip in software. ( Thats how this thread got started) PS...Good News,, I have found one way to put the pick to sleep without a switch or software,,,,,,,,,,,,,,,,,,,,,,,Just one piece of Hardware with no moving parts..............I always wondered why I kept this Claw Hammer in my office and not in my garage. It works great... but same problem as turning WDT off... It will not restart again on re-powerUP.. back to the drawingboard or in this case,,, Skate board. Regards Guys,,
Rix

Nice to know about the Fluke recording software. Is there anything out there, 3rd party, Google-able, hobbyist guy written that'll handle it for you? How about a video of the meter face itself? At least you can fast forward thru it. But you're right, you'd figure you would've caught a spike here and there.

At any rate, maybe this is one of those cases where you just have to make the battery bigger than you really want to so it will handle the extra current draw....ya know, avoid a complete redesign, cut your losses, etc.etc. That's what I'd do in a case like this. It's not optimal, but it might save a load of heartburn...

Archangel
- 1st March 2007, 02:28
Hmmmm, salt water electrolyte, make case out of 2 metals 1 insulator and who needs a battery?

skimask
- 1st March 2007, 02:32
Hmmmm, salt water electrolyte, make case out of 2 metals 1 insulator and who needs a battery?

How do you know it's salt water? :)
And I always thought 'salt water' wasn't salty enough for any sort of useful battery. I know about galvanic corrosion and all that, but that seems a bit short on juice. Maybe enough to keep a cap charged up for a burst of juice when it wakes up? Might be an interesting thing to try out someday...

Archangel
- 1st March 2007, 02:49
How do you know it's salt water? :)
And I always thought 'salt water' wasn't salty enough for any sort of useful battery. I know about galvanic corrosion and all that, but that seems a bit short on juice. Maybe enough to keep a cap charged up for a burst of juice when it wakes up? Might be an interesting thing to try out someday...
That was sort of what I was thinking, y'know maximum or dallas used to make some great little charge pump devices, you could maybe glue something together to maintain a small nicad, who knows how large a device he has under water, I know Zinc is really reactive with other metals, if it is of any size it could make pretty good current for quite a long time. I do not know it's salt water. I guess it might be a lake somewhere, 500 feet is pretty deep. Speaking of current, maybe there is water current harvestable to make power.
Problems cannot always be solved with in the box answers, I figured 500 feet was too deep for solar :)
JS

skimask
- 1st March 2007, 02:54
I figured 500 feet was too deep for solar :)
JS

And I'd be willing to bet that a wind turbine is catagorically out of the question! :)

Darrel Taylor
- 1st March 2007, 02:58
Hi Rix,

It looks like you've already found another way. But I thought I'd mention that the @SLEEP command needs to have a space in-between the @ and SLEEP.

@ SLEEP

I'm surprised it didn't give an error.

<br>

Darrel Taylor
- 1st March 2007, 03:39
And I always thought 'salt water' wasn't salty enough for any sort of useful battery. I know about galvanic corrosion and all that, but that seems a bit short on juice. Maybe enough to keep a cap charged up for a burst of juice when it wakes up? Might be an interesting thing to try out someday...

Actually, saltwater makes a pretty good electrolyte.
But it's not reversable. You have to change the anode when it's depleted.

Interesting device...
http://dragonet.com/fhp/
<br>

rixtalbert
- 2nd March 2007, 14:34
DT,,

While playing with your suggestion of adding the space between the @ and Sleep, I thought I would try to record the new current readings with the FLUKE 189. I had thought that I tried the two diffent settings before but I may have been side tracked looking for other problems.

Using the same code as I posted in the PDF above, I added the space between @ and Sleep. Below is the rusults with and without the space in the proper place.

@Sleep = 88uAmps on FAST MIN/MAX Fluke capture setting
@ Sleep = 102.8uAmps on FAST MIN/MAX Fluke capture setting

Real Strange..

Are all @ Commands used with Spaces and are all @ command to be in UPPER CASE TEXT? or does that matter?


Thanks again Guys..

Rix

Darrel Taylor
- 2nd March 2007, 15:46
Are all @ Commands used with Spaces

There are cases where you need a space, and others where you can't have a space. In general, only Labels, Macros and Variable assignments do not need a space. Any op-codes like movf, btfss or sleep must have a space.

If using PM as the assembler, then case doesn't matter. If using MPASM, then Case only matters for labels, variables and register names, but for op-codes, it doesn't matter.

Clear as mud, eh?

When you tried sleep with a space, did you turn off the watch dog timer?
<br>

rixtalbert
- 5th March 2007, 15:35
Darrel,


Sorry for taking so long to answer, covered with life stuff,

The WDT was ON on both occasions fo the last current test.

Another funny thing that happened in the last test was.

I left the circuit running while doing something else and about fifteen minutes later the chip restarted the cycle once and ran the motor and went back to sleep for a long time. I will try to record the exact amount of time that the thing is resetting and running the little motor routine.


Thanks again for you assistance.

Rix

mister_e
- 5th March 2007, 22:48
any schematic? any pin left unconnected? how far the whole thing is from your motor?

you know kind of stuff like that....

isee you have GPIO.3 unconnected and set as an input. could this pin wake up you PIC like a Wake up on pin change as stated in table 3-2?

OPTION register is already set for that by default. Register 4-2

and to me, your program should end with a STOP... unless it may do some strange thing.

Stop program execution and enter low power mode. All of the I/O pins remain in their current state. END works by executing a SLEEP instruction continuously in a loop. An END or STOP or GOTO should be placed at the end of every program to keep it from falling off the end of memory and starting over.

rixtalbert
- 18th March 2007, 14:42
Mister-E
I am just getting back to PIC's so here it goes.
I don't really have a drawn schematic.
GPIO.3 is not connected to anything. I was going to try to put a weak pull up on that pin, but I understand that the 10F series is not pin selectable when assigning weakpulls. They are either all on or off. Also I thought that weak pullups as well as external pull ups waste power.
I would just like to have GPIO.3 not look for a wake up on pin change and not have energy wasted with a pullup. Is there a way to do that, or is that just what I have to live with. I agree that the pin should no be floating. What do you think is the best way to do that?

As for PBP's STOP command per the manual. It states that this command does not place the microcontroller into low power mode. The microcontroller is still working as hard as ever. END QUOTE.
This comment is one reason I never used it. I agree that it looks like the watch dog timer was waking up every 2 to three seconds.
Quote from 10F manual:
9.6.1 WDT PERIOD
The WDT has a nominal time-out period of 18 ms, (with
no prescaler). If a longer time-out period is desired, a
prescaler with a division ratio of up to 1:128 can be
assigned to the WDT (under software control) by
writing to the Option register. Thus, a time-out period of
a nominal 2.3 seconds can be realized. These periods
vary with temperature, VDD and part-to-part process
variations (see DC specs).
Under worst case conditions (VDD = Min., Temperature
= Max., max. WDT prescaler), it may take several
seconds before a WDT time-out occurs.
End Quote from Manual.
I really don't know how I got the 2 to 3 seconds wakeup because I never set the prescaler ratio. I left it alone. Now that is funny.

So I will be playing and reading a little more today.

Thanks for your input mister e. I have enjoyed reading your post over the years.

Regards
Rix