Is it normal for interrupt initialization to trigger the ISR? RESOLVED- Thanks
CarlC
Posts: 29
While stepping through in debug mode, I find that changing the mode register to set WKPEND causes a triggering of my ISR in my initialization segment.
mov W,#$19
I even tried initially biasing my pins high (pulled up pins not connected to ground) in case seeing a low pin right after activating interrupts was causing a problem without effect.
In normal operation, my ISR uses the state of the WKPEND register (swapped through W) to determine the cause of an interrupt. I have problems when the ISR is called outside of the normal means. I guess I could put in a work around by setting a flag in the main body so the ISR is skipped through if the main hasn't been reached yet, but I'm wondering if there's a proper way to avoid running the ISR after making interrupts available during initialization.
Post Edited (CarlC) : 2/1/2006 6:19:15 AM GMT
mov W,#$19
I even tried initially biasing my pins high (pulled up pins not connected to ground) in case seeing a low pin right after activating interrupts was causing a problem without effect.
In normal operation, my ISR uses the state of the WKPEND register (swapped through W) to determine the cause of an interrupt. I have problems when the ISR is called outside of the normal means. I guess I could put in a work around by setting a flag in the main body so the ISR is skipped through if the main hasn't been reached yet, but I'm wondering if there's a proper way to avoid running the ISR after making interrupts available during initialization.
Post Edited (CarlC) : 2/1/2006 6:19:15 AM GMT
Comments
In your intialization code you need to clear the WKPEND register before you enable the wake ups following a sequence such as;
does this answer your question?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Bad spellers of the world untie!
that was exactly my problem. I forgot to clear all the interrupt flags before enabling the interrupts.