Paul pretty much summarizes everything in his reply to this. He does a great job. Most of my applications do something on keypress, then sleep, so I use the PORTB interrupt. If your PIC is on constantly, polling is the better solution. I agree with pretty much everything Paul states, except that using an interrupt is undesirable. Many applications "do something on keypress", so using a PORTB interrupt to start a debounce timer, and another interrupt when debounce complete, is a very convenient method for a lot of applications. I usually am tight on RAM, so using none at all for my keypad code (except for hardware flags) is rather convenient. ---------- > From: David Olson > To: PICLIST@MITVMA.MIT.EDU > Subject: Re: Newbie Toggle Switch Woes > Date: Tuesday, April 13, 1999 10:55 AM > > Justin, > > I know your mention of hardware is actually for the switch to generate an > interrupt but, would you consider a NAND gate latch setup? Or is this too > much or unnecessary hardware? I've build a sample circuit like this before > but I've never tested its resiliency with a range of switches that have > varying debounce times. Any information I've gathered from this approach has > not pointed to this being a "better" solution. > > Unfortunately, I need this to be as robust as possible and with the solution > being through software, I could at least "tune" the debounce if switches are > chosen outside a comfortable range. > > I'm in the investigation phase right now and I'm using some simple SPST, > normally open, momentary switches - I will ultimately move this to a setup > that is rubber keypad/PCB contact assembly, for which I really appreciate > the note from Paul Webster on switch/key design - that was great. > --SNIP