Byron, I have used this emergency task with both interrupts on change AND polling. It was a special circumstance when I had to test both a rising edge and after a while the level. "The railway station it's still on my desk near the workstation ! " best regards from Transylvania. Vasile win a free PCB at: http://www.piclist.com/techref/piclist/pcbcontest.htm On Wed, 10 Jul 2002, Bill & Pookie wrote: > Just take a close look at the code to see what > would happen if you got a second interupt while > working on the first one. > > Bill > > ----- Original Message ----- > From: "Byron A Jeff" > To: > Sent: Tuesday, July 09, 2002 11:15 AM > Subject: Re: [PIC]:What is the best method, > Interrupt or Polling or others? > > > > On Tue, Jul 09, 2002 at 09:46:10AM +0800, Pang > wrote: > > > Hi all, > > > > > > I would like to get some advice from everyone > on how best to tackle > > > this basic problem. My assembly codes > > > are segregated into different possible states > of the system that i > > > build. I think it can be considered a Moore > state machine. > > > > > > Now, of the many states, there is one state > that every states goes to > > > when the condition is right. Let say the > condition is a Emergency > > > switch. Once inside the state, some algorithm > is executed and when > > > the switch is flip back, the control will jump > to only a particular > > > state, let's call it A state. > > > > > > So my question is, what is the best way to > implement this? Hardware > > > interrupt, Software interrupt or just plain > old polling method? > > > > My answer is only half joking: > > > > The way that works. > > > > As long as your method doesn't interfere with > the operation of the other code, > > then it doesn't matter. Often one uses > interrupts when there isn't time for > > the processor to sit around polling. But if > those cycles are not going > > to be used for anything else, then polling is > fine. > > > > Make it work, then optimize. > > > > BAJ > > > > -- > > http://www.piclist.com#nomail Going offline? > Don't AutoReply us! > > email listserv@mitvma.mit.edu with SET PICList > DIGEST in the body > > > > > > > > -- > http://www.piclist.com hint: To leave the PICList > mailto:piclist-unsubscribe-request@mitvma.mit.edu > > -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads