> I eventually leave this loop, but after significantly more than > 6 cycles. How are you figuring it's more than 6 ? By measuring time ? Are you sure the 500ms delay is correct ? Have you tried running and monitoring it in MPLAB ? (with and without the delay500 enabled) Is the RAM byte "Counter" being used in another part of the program under a different name ? For example, have you managed to assign the same address to two names ? -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads