Hello, I am working on a Digital Calendar based around a PIC16F877 operating at 20MHz, for part of my degree project. My deadline is only a few weeks away, and I have been coming up against what seems to be an infinite loop for the past few weeks. I have written smaller test programs to try and ascertain the cause of the problem, but so far with no luck. Yet if I step through the code using MPLAB 5.11's simulator, it appears to return from the particular sub-routine correctly. The point in the code where it appears to simply stop is in the RTC_DELAY sub-routine. RTC_DELAY MOVLW D'254' MOVWF DELAY_COUNT ;set counter value RTC_DELAY_LOOP DECFSZ DELAY_COUNT,F ;dec delay_count, is zero? if yes, skip next GOTO RTC_DELAY_LOOP ;no, else loop RETURN ;yes, return It's a very simple routine, and I can't see how it is failing, though I am currently worried about completing on time, at all. I am using an ICEBreaker In-Circuit Emulator from Magenta Electronics (with the ICEBreaker programming and monitoring software), with a PIC16F877, interfacing with a DS1302 Real-Time Clock. Using MPLAB 5.11 for development/simulation/assembling. I can include the test programs and full program source if necessary. Any help would be greatly appreciated. For this part, I am simply trying to write-to and read-from the Real-Time Clock chip. -- All the best, Glenn Davidson -- http://www.piclist.com#nomail Going offline? Don't AutoReply us! email listserv@mitvma.mit.edu with SET PICList DIGEST in the body