>-----Original Message----- >From: Matt Marsh [mailto:matt@MATTMARSH.NET] >So, the program should start and light the LED by default. >When I press the button for the first time the LED should go >out and stay out until the system is reset. However, the LED >just comes on and stays on. > >Here is the code: >ISR > clrwdt > bcf INTCON,3 ; Reset timer interrupt > > movlw d'1' ; Subtract 1 from sequence number to > subwf SEQ,w ; make it zero based > addwf PCL,f > goto Sequence1 > goto Sequence2 The first thing I noticed about this is that you are not performing any context saving! You are modifying W both here and in the main loop (when a button is pressed). You should be saving any registers that the main loop isn't expecting to get clobbered before doing anything else in your ISR. The datasheet for the PIC you are using should have some example code that shows how to save STATUS and W which are generaly the most important two. Regards Mike ======================================================================= This e-mail is intended for the person it is addressed to only. The information contained in it may be confidential and/or protected by law. If you are not the intended recipient of this message, you must not make any use of this information, or copy or show it to any person. Please contact us immediately to tell us that you have received this e-mail, and return the original to us. Any use, forwarding, printing or copying of this message is strictly prohibited. No part of this message can be considered a request for goods or services. ======================================================================= Any questions about Bookham's E-Mail service should be directed to postmaster@bookham.com. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body