On Sat, Dec 06, 2008 at 02:59:15PM -0500, solarwind wrote: > On Sat, Dec 6, 2008 at 2:03 PM, Bob Ammerman wrote: > > Actuallay, you don't have to use interrupts in this case. > > Great! > > > set port B to all 0's > > read port B > > if port B is all 1's then no keys are down, so... > > enable interrupt-on-change > > ^ Interrupt? > > "Actuallay, you don't have to use interrupts in this case." > > I'm a bit confused. The PIC is set up so that if interrupts are disabled and an interruptable event occurs during SLEEP, then the PIC wakes up and resumes right after the SLEEP. So it isn't an interrupt, because an interrupt service routine isn't called, but it serves the purpose of putting the processor to SLEEP and making sure that it wakes up at the appropriate time. You snipped the relevant part of the code above where the next step was to put the processor to sleep. BAJ -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist