Searching \ for '[PIC]: interruptflag during 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/ints.htm?key=interrupt
Search entire site for: 'interruptflag during sleep ?'.

Exact match. Not showing close matches.
PICList Thread
'[PIC]: interruptflag during sleep ?'
2006\04\12@182346 by Stef Mientki

flavicon
face
I need a very low power application,
so the best from microchip I could find is the 16F87 or 16F88.

(MPS 430 from TI seems to be much better,
but as I'm not familiar with these chips ...)

Now the 16F8x, running at 32 kHz, still consumes (about 3..5 times) too
much.
As my application is quite simple,
detect if one (or more) edge occurred in each time epoch of 500 msec,
I could put the device in sleep mode, disable interrupts and
after wakeup test one of the interrupt flags.
This can save me up to 10 times the normal power
(assuming I need 50 msec to detect / clear / interpret / store the
interrupt flag).

Now the important question (which I can't figure out from the
datasheets) is:
can this interrupt flag be set and preserved during sleep mode (with
interrupts disabled) ???

thanks,
Stef Mientki

2006\04\12@190205 by Mike Hord

picon face
I'd have to say that it would, depending on which interrupt flag you're
wanting to check.

After all, with the processor asleep and the oscillator not running,
rule out any timer-based interrupts, UART based interrupts, etc.

If an INT edge based interrupt occurs, it can wake up the processor,
and needs to be cleared upon wakeup, so if that interrupt is masked,
the flag will still be set, it just won't wake up the processor.

So, yes, I'd have to say you can count on spotting that edge when
the PIC wakes up, even if the edge didn't directly wake the PIC up.

Mike H.

On 4/12/06, Stef Mientki <spam_OUTs.mientkiTakeThisOuTspammailbox.kun.nl> wrote:
{Quote hidden}

> -

2006\04\12@204724 by Jinx

face picon face
> can this interrupt flag be set and preserved during sleep mode (with
> interrupts disabled) ???

Hi Stef, F88 manual, 15.13.1

"Wake-up occurs regardless of the state of the GIE bit". That section
seems to focus on needing to wake from SLEEP, rather than not wake

"When GIE is cleared and any interrupt source has both its IE bit
and IF set.....

......If the interrupt occurs after a SLEEP instruction the device will
immediately wake from SLEEP"

You know, it would be quicker and tell you for certain by just
programming a chip ;-) Looking at Figure 15-7, Interrupt Logic,
my guess would be that the IF would be set

Interesting question though




2006\04\13@134703 by M. Adam Davis

face picon face
On 4/12/06, Stef Mientki <.....s.mientkiKILLspamspam@spam@mailbox.kun.nl> wrote:
> I need a very low power application,
> so the best from microchip I could find is the 16F87 or 16F88.
>
> (MPS 430 from TI seems to be much better,
> but as I'm not familiar with these chips ...)
>
> Now the 16F8x, running at 32 kHz, still consumes (about 3..5 times) too
> much.

Wow.  Out of curiosity, how little power do you have?  Last night I
programmed a 3 digit LCD counter using a 16f877 and found that without
using any low power modes it only consumes 23uA at 3V.  That'll run
for over a year on a CR2032 with the LCD on full time.

I've used the MSP430 devices and they are also low power, but at the
time I didn't optimize power usage since the rest of the circuit
(accelerometer, mainly) required 1mA, so there wasn't much to gain.
The main problem with them is they are expensive.  The main advantage
is the nice LCD controller, 16 bit data path, and multiplier.

-Adam

2006\04\13@153008 by Stef Mientki

flavicon
face


Jinx wrote:
>> can this interrupt flag be set and preserved during sleep mode (with
>> interrupts disabled) ???
>>    
>
> Hi Stef, F88 manual, 15.13.1
>
> "Wake-up occurs regardless of the state of the GIE bit". That section
> seems to focus on needing to wake from SLEEP, rather than not wake
>
>  
:-(
but nonetheless thanks !

So I've to detect the events with an external device,
maybe a capacitor,
or even a smaller capacitor with a MosFet.

cheers,
Stef

2006\04\13@153629 by Stef Mientki

flavicon
face


M. Adam Davis wrote:
> On 4/12/06, Stef Mientki <s.mientkispamKILLspammailbox.kun.nl> wrote:
>  
>> I need a very low power application,
>> so the best from microchip I could find is the 16F87 or 16F88.
>>
>> (MPS 430 from TI seems to be much better,
>> but as I'm not familiar with these chips ...)
>>
>> Now the 16F8x, running at 32 kHz, still consumes (about 3..5 times) too
>> much.
>>    
>
> Wow.  Out of curiosity, how little power do you have?  Last night I
> programmed a 3 digit LCD counter using a 16f877 and found that without
> using any low power modes it only consumes 23uA at 3V.  That'll run
> for over a year on a CR2032 with the LCD on full time.
>  
My first goal was to run 10 years on a CR2032 ;-)
then the consumption should be less than 2.5 uA.
Now the goal is 10 years on a CR2450 (+600 mAh),
so I can afford about 7 uA.
With 5uA for the WDT, 0.5 uA for the sleeping PIC,
an extra 0.5uA for the PIC when it's running,
I still have a whole 1 uA for the detector.
Should be doable.

cheers,
Stef

2006\04\13@161906 by olin piclist
face picon face
Stef Mientki wrote:
> With 5uA for the WDT,

That is way more than necessary.  You can either make your own external
timer, or use one of the new PICs with internal low power wakeup timer.
Last time I did an external timer it was something like 250nA average.  The
PIC low power wakeup can be less than 1uA if I remember correctly.

I've got a 16F630 running about 2 years on two CR2032 using my external
wakeup timer.  It mostly sleeps, but every 10 seconds it wakes up and sends
an RF message and a few burst of IR signature.


******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014.  #1 PIC
consultant in 2004 program year.  http://www.embedinc.com/products

2006\04\13@171234 by Stef Mientki

flavicon
face


Olin Lathrop wrote:
> Stef Mientki wrote:
>  
>> With 5uA for the WDT,
>>    
>
> That is way more than necessary.  You can either make your own external
> timer,
that might be a good idea
>  or use one of the new PICs with internal low power wakeup timer.
>  
any type numbers perhaps ?
(it's difficult to search on microchip sites :-(
(what I read from the figures, 16F630 uses max 6uA WDT)

cheers,
Stef

{Quote hidden}

2006\04\13@172501 by olin piclist

face picon face
Stef Mientki wrote:
> any type numbers perhaps ?

Not off the top of my head.  The new low power wakeup timer is in one or two
of the new smaller 16F parts.

> (what I read from the figures, 16F630 uses max 6uA WDT)

Right.  That's why I'm using my own external 250nA wakeup timer.


******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014.  #1 PIC
consultant in 2004 program year.  http://www.embedinc.com/products

2006\04\13@175135 by Stef Mientki

flavicon
face


Olin Lathrop wrote:
> Stef Mientki wrote:
>  
>> any type numbers perhaps ?
>>    
>
> Not off the top of my head.  The new low power wakeup timer is in one or two
> of the new smaller 16F parts.
>
>  
>> (what I read from the figures, 16F630 uses max 6uA WDT)
>>    
>
> Right.  That's why I'm using my own external 250nA wakeup timer.
>  
Wow, any change we might see the schematic ?

cheers,
Stef

2006\04\13@193647 by olin piclist

face picon face
Stef Mientki wrote:
>> Right.  That's why I'm using my own external 250nA wakeup timer.
>
> Wow, any change we might see the schematic ?

There's no wow or magic.  It's just a regular transistor oscillator with
large resistors.  It's also very inaccurate, but so is the watchdog and it
doesn't matter for the same reason.  This timer fires every 50-200mS
depending on voltage part variations, phase of the moon, etc.  Every 1000 or
so timer ticks I leave the internal 4MHz oscillator of the PIC running to
measure the timer.  Since that's only .1% of the time, it doesn't add much
to the power budget.  The unit's temperature and battery level don't change
that much in 50-200 seconds.


******************************************************************
Embed Inc, Littleton Massachusetts, (978) 742-9014.  #1 PIC
consultant in 2004 program year.  http://www.embedinc.com/products

2006\04\13@193838 by Jinx

face picon face

> So I've to detect the events with an external device,
> maybe a capacitor,
> or even a smaller capacitor with a MosFet.

Hi Stef, I didn't make the point as clearly as Mike Hord

"When GIE is cleared and any interrupt source has both its IE bit
and IF set.....

......If the interrupt occurs after a SLEEP instruction the device will
immediately wake from SLEEP"

IOW, you are not meeting one of the requirements for the PIC to
wake up, ie the IE bit is clear. So I'd expect, as the hardware is
**capable** of waking the PIC, that the IF would be set in SLEEP
but not wake the PIC up if IE is clear

2006\04\13@215059 by Robert Ammerman

picon face

>> Hi Stef, F88 manual, 15.13.1
>>
>> "Wake-up occurs regardless of the state of the GIE bit". That section
>> seems to focus on needing to wake from SLEEP, rather than not wake
>>
>>
> :-(
> but nonetheless thanks !

Note that the above discussion refers to the GIE bit. However, if you clear
the INT0IE bit, then the INT0IF bit will still be set on an appropriate
edge, but you will not be woken from sleep.

Bob Ammerman

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