solarwind wrote: >> Just glanced at the code there and first thing off is you need enable >> interrupts by setting the relevant bits in the INTCON register or an >> interrupt will never be caught so your code will just get to the >> sleep part and stay there. You also need to clear the relevant bit >> of the >> ANSEL register to set the input to digital for the push button. >> Inputs default to analogue on power-up. This can be seen on page 98 >> of the datasheet in the A/D converter section. Above each bit it >> says R/W - >> *1*, this mean it defaults to 1. Also you have no interrupt function >> or ISR as it's called. When an interrupt does occur code execution >> will jump to the interrupt vector and needs to be handled from there, >> at a minimum you need to clear the interrupt flag to prevent an >> infinite loop of interrupts. You say you looked at the datasheet but >> it seems you didn't. Getting started can be hard but there are *so* >> many examples out there on the net just ask Uncle Google and he'll >> sort you out. Hope this help somewhat... oh and if you search the >> list archives on the 23 Nov this year you will get my post about >> timer0 interrupts which should help shed some light and how >> interrupts work. > > I don't know how to do this. Do what precicely? There are many possible "this" in the paragraph above. > The data sheet doesn't explain anything either. Of course it does. Microchip documentation of their PICs is well written and complete. If you don't understand something specific then ask, but don't try blaming the data sheet. All that does is undermine your credibility, not its. ******************************************************************** Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products (978) 742-9014. Gold level PIC consultants since 2000. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist