Then really neither of the above replies are suitable.
This is because whilst you are away doing something, (for example the PAUSE instruction), you are not looking for the event in order to trigger your Output IMMEDIATELY. Even with my suggested modification, you won't miss the pulse, BUT you'll only do something about it some time later - and that time could be delayed by anything up to 1mS.
You would need something like Darrel's INSTANT INTERRUPTS - but NOT to Poll the input pin, but to give you your Timeout. If setting your Output pin relative to the Input trigger is so critical, then I would even consider if a PIC is the suitable device - you could do it quicker with discrete logic.
Bookmarks