Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Electronic Equipment > Embedded > Sleeping PICs L...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 11 Topic 12419 of 13381
Post > Topic >>

Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main Code

by bw@[EMAIL PROTECTED] (B1ackwater) Jun 24, 2008 at 09:42 PM

OK ... a minor mystery ...

While I've used PICs for many things, I've never made
use of the SLEEP mode. For my 18f2620, the docs state :

"All external interrupts (INT0, INT1 and INT2) can
wake-up the processor from SLEEP, if bit INTxE was
set prior to going into SLEEP. If the global interrupt
enable bit GIE is set, the processor will branch to
the interrupt vector following wake-up."

Well, it doesn't. 

I *do* have GIE enabled, and INT1, because the PIC
needs to be awakened by an external device. WDT
timeouts DO happen. The external interrupt DOES work
also, awakening from sleep and calling the ISR just
like it's supposed to.

BUT ... a WDT timeout while sleeping does NOT branch to
the ISR, but instead just picks up the program exactly
where it left off, ie executing the code beyond the
SLEEP instruction. This is OK, convenient even ... 
but not what the docs SAY it will do. 

The program is writ in MikroPascal, but the actual
SLEEP command is an in-line ASM statement, so MP
ought not be saving the current program counter or
anything else before SLEEP. 

Any clues as to why this may be happening ? Mystery
registers that could de-rail the call to the ISR
when interrupts are enabled ? Any info helpful.
 




 11 Posts in Topic:
Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main Cod
bw@[EMAIL PROTECTED] (B1  2008-06-24 21:42:13 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
Pete <pjetson@[EMAIL P  2008-06-24 23:20:27 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
bw@[EMAIL PROTECTED] (B1  2008-06-25 13:12:00 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
John Temples <usenet@[  2008-06-25 00:11:07 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
bw@[EMAIL PROTECTED] (B1  2008-06-25 13:27:27 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
cs_posting@[EMAIL PROTECT  2008-06-25 07:14:12 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
"John B" <sp  2008-06-25 11:02:23 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
bw@[EMAIL PROTECTED] (B1  2008-06-25 13:43:39 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
"John B" <sp  2008-06-25 15:49:42 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
Neil <NeilKurzm@[EMAIL  2008-06-27 00:32:48 
Re: Sleeping PICs Lie ? - WDT + GIE <> ISR but Just Resumes Main
bw@[EMAIL PROTECTED] (B1  2008-07-04 20:33:29 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Mon Dec 1 17:30:25 CST 2008.