Searching \ for 'Sleep Mode Application' 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/index.htm?key=sleep+mode+application
Search entire site for: 'Sleep Mode Application'.

Truncated match.
PICList Thread
'Sleep Mode Application'
1997\04\22@194723 by Jon Mills

flavicon
face
I have an application which requires me to count up pulses coming from an
external sensor. Unfortunately, I have to run from a battery - therefore I
will need to use the micro in SLEEP mode for much of the time. I am hoping
to use a 16C54.

Does anyone have any suggestions as to the best way to implement this?

Does the hardware counter on the '54 keep working in SLEEP mode, or will I
need  to use the external reset pin somehow?

Thanks - in advance.

Jon Mills.
Mail: spam_OUTjonmillsTakeThisOuTspamfreewheeling.com

1997\04\23@005927 by John Payson

picon face
|I have an application which requires me to count up pulses coming from an
|external sensor. Unfortunately, I have to run from a battery - therefore I
|will need to use the micro in SLEEP mode for much of the time. I am hoping
|to use a 16C54.

The 16C54 is pretty limitted here; the only ways the device can awaken from
SLEEP are via watchdog or via /MClr.  If you are running the part in RC mode,
it will start up pretty quickly whenever the watchdog barks; if polling at
18ms nominal is sufficient, your battery drain should be minimal.  If you're
using a crystal, however, it will have to start up every time you want to
wake up, requiring you to spend much more time awake.

There are seven approaches I can suggest:

[1] Use the watchdog to wake to PIC periodically and check the input.  If
   the input will be low for a long time, then high for a long time, etc.
   this approach may work quite reasonably.

[2] Any PIC outside the 16C5x series can be set to wake up when a port pin
   changes.  You'd still have to deal with oscillator startup time if you're
   using a crystal, but if the things you're counting don't happen too often
   that shouldn't be a problem.  This approach is best if the input signal
   consists of brief pulses that are seperated by some dead time.

[3] Some of the PICs have a counter which can count external pulses which are
   not synchronized to the PIC's clock; the counter can thus run even when
   the PIC is asleep.  Such a counter would be ideal for this application,
   though it may not justify the cost of the higher-powered PIC (unless you
   needed the fancy PIC for some other reason as well)

[4] Depending upon your exact application, you *MAY* be able to use the RTCC
   of a PIC (even a 16C5x) for this purpose.  The key is to recognize that
   the RTCC itself samples the output of the prescalar every clock cycle.
   If the output of the prescalar doesn't change more than once on any cycle
   the counter will count reliably.  For example, if you're only interested
   in counting every 16 input pulses, and your input frequency is less than
   440Hz (16/2/18ms) you could set the watchdog to wake you up every 18ms
   and look at the RTCC.  Unfortunately, the prescalar would be unavailable
   for the watchdog and the RTCC would be unavailable for timekeeping.

[5] Alternatively, if as above your input rate is moderately fast and you
   only need to count every 'n'th pulse, you could add an external divider
   and feed the output of that into the PIC.

[6] If you don't like the thought of having to jump through hoops to put your
   PIC to sleep and wake it up, you could elect to instead use a 32,768Hz
   crystal and let the PIC run constantly.  A PIC at 32KHz may use less
   power than a PIC which is constantly switching between 0 and 4MHz and may
   be easier to code as well.

[7] Finally, if your application requires that the PIC sometimes run fast but
   sometimes not, and if none of the speeds are really critical, you could
   wire up an RC oscillator circuit for variable speed operation.  Note that
   you won't be able to reduce current as much as with the watch crystal,
   since the oscillator needs some bias current to run reliably, but it is
   pretty easy to make an oscillator that will switch between, say, 1MHz and
   100Khz by putting a load capacitor between the oscillator pin and a port
   pin (when the port is tri-stated, the chip will run much faster; when the
   port is outputting, the chip will slow down).

|Does anyone have any suggestions as to the best way to implement this?

|Does the hardware counter on the '54 keep working in SLEEP mode, or will I
|need  to use the external reset pin somehow?

|Thanks - in advance.

Attachment converted: wonderland:WINMAIL.DAT (????/----) (0000E5C2)

1997\04\23@034907 by Tony Grimer

picon face
Tony Grimer
Senior Lecturer University of Wolvs.
.....CM1918KILLspamspam@spam@mail.wlv.ac.uk
Tel - 01902 321810


----------
> From: Jon Mills <jonmspamKILLspamGECMETERS.CO.UK>
> To: .....PICLISTKILLspamspam.....MITVMA.MIT.EDU
> Subject: Sleep Mode Application
> Date: 22 April 1997 12:11
>
> I have an application which requires me to count up pulses coming from an
> external sensor. Unfortunately, I have to run from a battery - therefore
I
> will need to use the micro in SLEEP mode for much of the time. I am
hoping
> to use a 16C54.
>
> Does anyone have any suggestions as to the best way to implement this?
>
My only comment is based on the experience of the '54 Battery powered
using a 32KHz crystal, the start up time on the crystal circuit can cause
problems in getting a wake up status  set up I had a lot of problems ...

My solution was based on a little bit of external CMOS gating to fire the
MCR pin when I wanted to wake up. This kept the battery drain to virtually
nothing for the '54 and the CMOS when I put it to sleep.

The problem with using the watch dog to wake up is the drain is higher you
get woken up quite frequently which did not suit my application and the
drain was higher since the counter was working.

I have a nifty bit of RC network design that allows you to monitor inputs
for activity and creates the MCR wake up if you need it, mail me direct and
I will send a copy..
> Does the hardware counter on the '54 keep working in SLEEP mode, or will
I
> need  to use the external reset pin somehow?
>

1997\04\23@042425 by Keith Dowsett

flavicon
face
|I have an application which requires me to count up pulses coming from an
|external sensor. Unfortunately, I have to run from a battery - therefore I
|will need to use the micro in SLEEP mode for much of the time. I am hoping
|to use a 16C54.

My first bet would be to use another PIC which allows wake-up on change. If
that is not an option how about using a CMOS latch (maybe even a capacitor
and a diode if your pulse is big enough) and checking every 18mS with the
watchdog?

What sort of frequency are you expecting? How wide and what source impedance?

Keith.
==========================================================
Keith Dowsett         "Variables won't; constants aren't."

E-mail: EraseMEkdowsettspam_OUTspamTakeThisOuTrpms.ac.uk
  WWW: http://kd.rpms.ac.uk/index.htm

1997\04\23@144534 by Gerhard Fiedler

picon face
At 00:20 23/04/97 -0500, John Payson wrote:
>|I have an application which requires me to count up pulses coming from an
>|external sensor. Unfortunately, I have to run from a battery - therefore I
>|will need to use the micro in SLEEP mode for much of the time. I am hoping
>|to use a 16C54.
>
>[5] Alternatively, if as above your input rate is moderately fast and you
>    only need to count every 'n'th pulse, you could add an external divider
>    and feed the output of that into the PIC.

A variation of this approach -- if space and component count is not the big
concern -- might be an external counter and a shift register (to read the
counter outputs, if you can't find a counter with a serial output).

Gerhard

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