>I am having a problem with waking my 16F628 from SLEEP, I want it to wake >up when the button is pressed, in other words RB0 is now at 0V. I have set >the PIC to wake up on the falling edge, does this mean that when the button >is at 0V = PIC now awake?, as this is how I understand it? If you set RB0 as an input, set the edge trigger for falling edge, and configure your push-button with a pullup resistor to +5V and have it ground out when pressed, then pressing the button will cause the RB0 interrupt to occur and wake the device from sleep. The chip will run through the ISR, then return to the next instruction just after the SLEEP instruction. A 100 ohm resistor from button to ground wouldn't hurt as a safeguard. >Problem= If long cables are used for the switch, it picks up noise and the >software thinks the button has been pressed! I would say to just filter the line. But I don't know how, I'm not an EE. Someone else may help you with this. >The problem is that I cannot find away of debouncing the button, as the way >I have it configured, it will not Wake Up until the button is pressed AND >released, the exact opposite of what I want. Configure it as I've said and it should work fine. You shouldn't have to test it or debounce it, though you could always just software debounce it to 20ms inside the ISR. In fact, you could wait for a button release inside the ISR also, then return only after it's released. --Andrew _________________________________________________________________ Chat with friends online, try MSN Messenger: http://messenger.msn.com -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body