Hiya, gang. I'm trying to measure the period of a pulse that varies from 5mS through 30mS with at better than 10 uS resolution. The target processor is running at 4 MHz (1uS instruction cycles). My problem is that I need a timeout function, so that a missing signal doesn't become a fatal condition. The easiest way seemed to call for a 16 bit counter. I immediately thought of Andrew Warren's fast 5 cycle counter, but I can't think of an easy way to detect overflow without increasing the loop time drastically. so... I came up with the following: ;measure HI period clrf HiPerLO clrf HiPerHI movlw 1 MeasHiPerLoop ;8 cycles per count addwf HiPerLO,F ;add puts carry in known state skpnc ;lower byte roll over? addwf HiPerHI,F skpnc ;upper byte roll over? goto TimeOut btfsc PIN ;pin still HI? goto MeasHiPerLoop I get 8 cycles for the loop. I can also limit my timeout period by using bit tests on the high byte if necessary (replace the 2nd 'skpnc' with a btfsc HiPerHI, n). But I REALLY like Andy's 5 cycle version and am hoping that someone can come up with an idea on how to do better than what I've come up with. Just a reminder: here is Andy's 5 cycle timing loop: Andrew Warren wrote: ; 5 cycles per count CHECK_PULSE: INCFSZ pulse_width_lo DECF pulse_width_hi BTFSC PULSE_PORT,PULSE_BIT GOTO CHECK_PULSE DONE: MOVF pulse_width_lo,W ADDWF pulse_width_hi My other thought was to use Andy's version, then use the watchdog timer to limit how long I would wait for the pulse to end. But I need the prescaler for my main timekeeping routines - and I couldn't reliably measure pulses that would approach the full time that the counters would be capable of. Ideas, suggestions? Thanks! dwayne