Searching \ for '[PIC]: PIC12f629 need help with timed sleep.' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/microchip/time.htm?key=time
Search entire site for: 'PIC12f629 need help with timed sleep.'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: PIC12f629 need help with timed sleep.'
2003\03\06@135956 by Paul Kennedy

flavicon
face
I want to put a 12f629 pic into low power sleep mode for aprox 16 seconds
(not critical.)

I know you can do it by using the watchdog oscilator, but this newbie has
absolutely no idea how to do it.

I have scoured the archive but can't seem to find any resource that can help
me.

can someone please point me in the right direction.

thanks
Pk.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email spam_OUTlistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\03\06@143330 by Andre Abelian

picon face
Pk,

Use second 32k crystal in sleep mode to count seconds and after 16
Counts timer1 over flow will case interrupt and it will wake up from
sleep.

Andre Abelian






{Original Message removed}

2003\03\06@144803 by Olin Lathrop

face picon face
> I want to put a 12f629 pic into low power sleep mode for aprox 16
> seconds (not critical.)
>
> I know you can do it by using the watchdog oscilator, but this newbie
> has absolutely no idea how to do it.

You enter sleep mode with the SLEEP instruction.  Various events can cause
a wakeup from sleep, including the watchdog timer.  However, watchdog
timer causes a reset so would therefore not continue from the SLEEP
instruction (unless they put in a special case for that.  I've never done
this, so check the manual).  Also, 16 seconds is longer than a single
watchdog timer timeout, so you will have to count multiple watchdog
timeouts to get to approximately 16 seconds.


*****************************************************************
Embed Inc, embedded system specialists in Littleton Massachusetts
(978) 742-9014, http://www.embedinc.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam@spam@mitvma.mit.edu with SET PICList DIGEST in the body

2003\03\06@145013 by Dale Botkin

flavicon
face
On Fri, 7 Mar 2003, Paul Kennedy wrote:

> I want to put a 12f629 pic into low power sleep mode for aprox 16 seconds
> (not critical.)

If it's really, really not critical (like if plus or minus a second or two
is OK), just use six or seven SLEEP instructions with the watchdog
configured for 2.3 seconds.  A 32kHz xtal on timer1 will work for much
more precise timing.

Dale
--
It's a thankless job, but I've got a lot of Karma to burn off.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamKILLspammitvma.mit.edu with SET PICList DIGEST in the body

2003\03\06@145842 by Dale Botkin
flavicon
face
On Thu, 6 Mar 2003, Olin Lathrop wrote:

> You enter sleep mode with the SLEEP instruction.  Various events can cause
> a wakeup from sleep, including the watchdog timer.  However, watchdog
> timer causes a reset so would therefore not continue from the SLEEP
> instruction (unless they put in a special case for that.  I've never done
> this, so check the manual).

WDT wakeup from SLEEP is viewed as the resumption of normal operation.
During SLEEP it's called WDT wake-up, when not in SLEEP mode it's called
WDT Reset.  This applies to all 12/16x parts I have tried, not just the
12F629 and is documented in the data sheets and the PIC Midrange manual.

Dale
--
It's a thankless job, but I've got a lot of Karma to burn off.

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email .....listservKILLspamspam.....mitvma.mit.edu with SET PICList DIGEST in the body

2003\03\06@152736 by Spehro Pefhany

picon face
At 01:49 PM 3/6/2003 -0600, you wrote:
>On Fri, 7 Mar 2003, Paul Kennedy wrote:
>
> > I want to put a 12f629 pic into low power sleep mode for aprox 16 seconds
> > (not critical.)
>
>If it's really, really not critical (like if plus or minus a second or two
>is OK), just use six or seven SLEEP instructions with the watchdog
>configured for 2.3 seconds.  A 32kHz xtal on timer1 will work for much
>more precise timing.

The worst case variation (including temperature) is a lot greater than
1-2 seconds in 16. Each period can be as short as 7ms or as long as 33ms,
without the prescaler. And that's not tested, but characterized,
meaning that a certain percentage of chips will fall outside of that
range.

IOW if you did 7 * 128, you'd have a typical time of 16.1 seconds, but
a minimum of 6.27 seconds and a maximum of 29.6 seconds.

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
EraseMEspeffspam_OUTspamTakeThisOuTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email listservspamspam_OUTmitvma.mit.edu with SET PICList DIGEST in the body

2003\03\06@161248 by Jinx

face picon face
> I know you can do it by using the watchdog oscillator, but this
> newbie has absolutely no idea how to do it

You'd need something like this, assuming a ~2.3 second WDT,
ie maximum (128) pre-scaler

          movlw  0xf9       ;count up to 00 (7 WDT wake-ups)
          movwf  count

zzzz     sleep                ;power down
           incfsz  count    ;increment count on WDT wake-up
           goto     zzzz     ;not done, back to sleep

           more code      ;resumes here after 16.1 seconds

Don't forget to enable the WDT in CONFIG. If you use the pre-
scaler, assign it to WDT in OPTION. The WDT has a nominal
period of 18ms, and you could get closer to 16 seconds by
using a pre-scaler of 8 and a 111 count (16000/18=888, 8*
111*0.018 = 15.984s), but this does use fractionally more
power because of the greater number of wake-ups and WDT
is temperature-sensitive anyway

Note that the instruction after the SLEEP is pre-loaded at the
time the SLEEP is executed, and has immediate priority on
wake-up, ahead of any IRQs. If you have a wake-up source (eg
pin interrupt) that you wish to be the program flow controller you
should put an NOP after the SLEEP. This will cause the interrrupt
jump to be performed on wake-up

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email @spam@listservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2003\03\06@162246 by Jinx

face picon face
> The worst case variation (including temperature) is a lot
> greater than 1-2 seconds in 16. Each period can be as
> short as 7ms or as long as 33ms, without the prescaler.
> And that's not tested, but characterized,meaning that a
> certain percentage of chips will fall outside of that range

My experience with a few PICs has been that WDT is quite
dependably 18ms at 25C. As you say though, temperature
is a factor, approximately 0.1s / 5C. Not a good idea to rely
on WDT for accurate timing unless tested in the actual chip
used and/or the application can tolerate variations

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email KILLspamlistservKILLspamspammitvma.mit.edu with SET PICList DIGEST in the body

2003\03\06@164155 by Jinx

face picon face
> WDT wakeup from SLEEP is viewed as the resumption of
> normal operation. During SLEEP it's called WDT wake-up,
> when not in SLEEP mode it's called WDT Reset

Paul, one important thing about using WDT. It can be turned
on/off only through CONFIG, meaning when you aren't using
it for the SLEEP wake-up function, you'll have to dot a few
CLRWDT instructions through your code to stop it resetting
the PIC. That would be another advantage to using the max
pre-scaler, as a CLRWDT needs to be executed only every
2.3s, which should be fairly easy to do

--
http://www.piclist.com#nomail Going offline? Don't AutoReply us!
email RemoveMElistservTakeThisOuTspammitvma.mit.edu with SET PICList DIGEST in the body

2003\03\07@043538 by hael Rigby-Jones

picon face
> -----Original Message-----
> From: Jinx [SMTP:spamBeGonejoecolquittspamBeGonespamCLEAR.NET.NZ]
> Sent: Thursday, March 06, 2003 9:23 PM
> To:   TakeThisOuTPICLISTEraseMEspamspam_OUTMITVMA.MIT.EDU
> Subject:      Re: [PIC]: PIC12f629 need help with timed sleep.
>
> > The worst case variation (including temperature) is a lot
> > greater than 1-2 seconds in 16. Each period can be as
> > short as 7ms or as long as 33ms, without the prescaler.
> > And that's not tested, but characterized,meaning that a
> > certain percentage of chips will fall outside of that range
>
> My experience with a few PICs has been that WDT is quite
> dependably 18ms at 25C. As you say though, temperature
> is a factor, approximately 0.1s / 5C. Not a good idea to rely
> on WDT for accurate timing unless tested in the actual chip
> used and/or the application can tolerate variations
>
I'm hoping that's  0.1ms? :o)

Mike


=======================================================================
This e-mail is intended for the person it is addressed to only. The
information contained in it may be confidential and/or protected by
law. If you are not the intended recipient of this message, you must
not make any use of this information, or copy or show it to any
person. Please contact us immediately to tell us that you have
received this e-mail, and return the original to us. Any use,
forwarding, printing or copying of this message is strictly prohibited.
No part of this message can be considered a request for goods or
services.
=======================================================================
Any questions about Bookham's E-Mail service should be directed to RemoveMEpostmasterspamTakeThisOuTbookham.com.

--
http://www.piclist.com hint: To leave the PICList
piclist-unsubscribe-requestEraseMEspam.....mitvma.mit.edu>

2003\03\07@051140 by Jinx

face picon face
> > My experience with a few PICs has been that WDT is quite
> > dependably 18ms at 25C. As you say though, temperature
> > is a factor, approximately 0.1s / 5C. Not a good idea to rely
> > on WDT for accurate timing unless tested in the actual chip
> > used and/or the application can tolerate variations
> >
> I'm hoping that's  0.1ms? :o)
>
> Mike

Er...ummm..... I double-checked and get ~0.1ms / degC for an
18ms WDT period. I didn't factor in the pre-scaler or the 10C

Check, just in case I made another blue

WDT with /128 pre-scaler

2.2125s @ 20C
2.3324s @ 30C

Diff = 0.1199s / 10C = 0.01199s / C

/128 = 0.0000937 = 0.094ms / 18ms period / degC

'kay ?

--
http://www.piclist.com hint: To leave the PICList
EraseMEpiclist-unsubscribe-requestspammitvma.mit.edu>

2003\03\07@154341 by Brent Brown

picon face
{Quote hidden}

Sounds right to me too. In a project with WDT configured as above and
TMR1 running a 32kHz crystal to produce a wake-up from sleep every 2
seconds I observed my PIC waking up earlier than expected when cooled
in a refrigerator. The watchdog timer period had dropped to something
less than 2 seconds and consequently caused a wake from sleep just
before TMR1 was due to cause the wake up.

--
Brent Brown, Electronic Design Solutions
16 English Street, Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/txt: 025 334 069
eMail:  RemoveMEbrent.brownEraseMEspamEraseMEclear.net.nz

--
http://www.piclist.com hint: To leave the PICList
RemoveMEpiclist-unsubscribe-requestspam_OUTspamKILLspammitvma.mit.edu>

2003\03\09@012612 by Paul Kennedy

flavicon
face
Hi Brent.

I find it interesting that I look to a global mail list for help and someone
from my own town answers my question.
:o)

thanks for your input.


Paul Kennedy
Dominon road
Hamilton.

{Original Message removed}

2003\03\09@014100 by Paul Kennedy

flavicon
face
thanks Jinx
this did the job perfectly.




----- Original Message -----
From: "Jinx" <RemoveMEjoecolquittTakeThisOuTspamspamCLEAR.NET.NZ>
To: <EraseMEPICLISTspamspamspamBeGoneMITVMA.MIT.EDU>
Sent: Friday, March 07, 2003 10:09 AM
Subject: Re: [PIC]: PIC12f629 need help with timed sleep.


{Quote hidden}

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

2003\03\09@060408 by Brent Brown

picon face
> I find it interesting that I look to a global mail list for help and
> someone from my own town answers my question. :o)

...next time you set GIE make sure the Hamilton flag is disabled?
Happy PIC'ing!

--
Brent Brown, Electronic Design Solutions
16 English Street, Hamilton, New Zealand
Ph/fax: +64 7 849 0069
Mobile/txt: 025 334 069
eMail:  brent.brownSTOPspamspamspam_OUTclear.net.nz

--
http://www.piclist.com hint: The list server can filter out subtopics
(like ads or off topics) for you. See http://www.piclist.com/#topics

More... (looser matching)
- Last day of these posts
- In 2003 , 2004 only
- Today
- New search...