Hi,

It's not the McDo Drive-in of code here ...

how do you want to use your processor ??? Hysteresis needed ???

as many ways are possible I can't ( and do not want ) give you a ready to burn application.

- use of comparators ?
- use of RCTime command ?
- use of the CCP module ?
- ???

Now ... as Porta.4 is generally an open collector pin ... you can't make it high !!! ( lol ) but just let it float ...

try to have a clearer view of what you want to do ... and show us what you already have looked for.

Alain