I always setup a dummy interrupt routine and test for watchdog timeout in my code with just a NOP. That way you can put a breakpoint on the NOP and quickly find out if anything unexpected is going on. Roger -----Original Message----- From: pic microcontroller discussion list [mailto:PICLIST@MITVMA.MIT.EDU] On Behalf Of Mark Gojkovic Sent: 04 July 2003 04:44 To: PICLIST@MITVMA.MIT.EDU Subject: [PIC]: What am I doing wrong with this code? Hi, I am having problems with the PIC ceasing to work after a certain number of instructions has been used up. I have no idea what's causing this so I hope that I can get some help. I am trying to make a small "alarm" box that will dial a pre- programmed phone number when a switch is closed. The dialing is done using a Mitel MT8880 DTMF transceiver and the number storage is done via two switches (ie click*click*click*ENTER) should store 3 as a digit in the phone number. Nothing too complex. The problem I am having (and have been having for over 2 weeks now) is that any time I would add some "code-intense" routines the PIC would stop working when programmed. To see where the problem occurs I started with a piece of working code. Then I started adding NOPs until it crapped out. The PIC doesn't just stop working but it stays in routines it shouldn't stay in, and skips others that it must go to, etc. The only difference between the two attached code listings is an additional NOP in the non-working program. I have no idea why this is happening since I am not even using half of the PIC16F84's program memory. I have used PICs before and nothing like this has ever happened. Additionally, anyone I've asked had no idea what the problem is. Code listings: http://www.contemporarycustoms.com/images/not_working.txt http://www.contemporarycustoms.com/images/working.txt I tried the same code (with some minor processor-specific changes) on a PIC16F876 and a PIC16F628 with identical results. I am using MPLAB (v. 5.00.16) and PicStart Plus running in WindowsXP. Any help would be appreciated while I still have hair left to pull out. :-) Mark -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body