or 5 good pulses in a row
Code:
DEFINE PULSIN_MAX 500   ; why wait longer if its already out of limits (may need adjustment)
init_ok  var byte
init_ok=5

init:

while portc.2    ;  wait till portc.2 goes low 
wend
while  init_ok   ; or init_ok>0 if you like
pulsin portc.2 , 1, vara
if abs(vara-150)<=10 then 
init_ok=init_ok -1
else
init_ok=5
endif
wend