You are not waiting 750uS between sending the pulse and measuring the return pulse - if that's what you're trying to do. It may be a case of read-modify-write where the output doesn't actually have time to return to LOW between the PulsOut and PulsIn command and therefor the PulsIn command misses the return pulse - just an idea.
If you know that it will be at least 750uS between the end of the outgoing pulse and the beginning of the return pulse then try inserting a PauseUs 700 or something between the PulsOut and PulsIn commands.
/Henrik.
Bookmarks