On Sun, Dec 7, 2008 at 6:29 PM, William Chops Westfield wrote: > There's this general problem explaining things to people who have > significant experience in some related area but nothing in the area in > question. If you word your answers too simply it comes across as > insulting or isn't useful, but it's very easy to trip over a line into > terms that just aren't part of the questioner's vocabulary (the whole > "mil" thing being a fine example.) In microcontrollers, this usually > shows up when someone has a lot of electronics background but has > never done software, or a lot of software background but has never > done electronics. I run into it frquently, trying to find books on > windows programming for someone with a lot of experience in CLI and > embedded software. > > So in order to do something with interrupts in general, you need to: > > 1) Set up some code that is executed when the interrupt occurs (The > "Interrupt Service Routine" or ISR) > 2) configure the Interrupt Controller and/or interrupt vector table so > that the desired interrupt or hardware signal will cause a jump/call > to the ISR code. > 3) configure the device that is supposed to generate the interrupt > appropriately. > 4) globally enable interrupts at the CPU level. > > In your sample snippet of code, you did (3) without doing any of the > other things. > It actually raised an interesting question for me (I've never used > change pin interrupts): does IoC configured on a port cause the PIC to > wake up from sleep even if higher levels of interrupt control aren't > enabled? It seems like it should, but then if it did I would think > your code would work. > > Some CPUs return to sleep mode when they're done executing the ISR, if > they were in sleep mode when the interrupt occurred. I don't recall > whether the PIC is one of them. Sometimes this is a consequence of > sleep status being part of the "status register" that an interrupt > saves automatically. If so, part of the ISR has to be explicitly > change the status register or sleep status before returning. > > BillW > > -- > http://www.piclist.com PIC/SX FAQ & list archive > View/change your membership options at > http://mailman.mit.edu/mailman/listinfo/piclist > Thank you for understanding my position. I don't know too much about the specifics of PICs and know almost nothing about interrupts in general. I'll do the other three steps that you have outlined. It is difficult to learn when all you get when you ask a question is GOOGLE IT NOOB. @Others: That being said, almost all or 100% of the stuff I've asked can be found on google, but the thing about google is you have to KNOW what you're wanting to find and KNOW the right question to ask. I DON'T know the right question. That's where other humans come in - they interpret my questions and either tell me what the right question is, or simply paste some links or even explain the solution to me. This I am grateful for. It's not that I'm too lazy to google it, It's just that google doesn't always give you the right answers to your question and sometimes you don't know the right question to ask. Please understand, I'm not doing this on purpose. I'm just trying to learn. -- ..::[ solarwind ]::.. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist