Hi all,

I am using a 12F675, running its internal clock.


What I am trying to get my head around some timing loops,
I am trying to do following...

I need an output to trigger as soon as the pic gets an input, (easy)
But it needs to hold latched for about 20 seconds from the time the input is released.

If an input is applyed to the pic within the 20 seconds the timer needs to reset back to 20 seconds until the input is released. (then carry on as before)

I then need to be able to cancel the 20 second delayed latch by applying a second input
to the pic. (clearing the delay and lifting the latched output)


Any ideas or advice would be great,

Cheers
Dave....