sayzer:
I'll give it a try and see if that helps...
If these changes made no difference, then you have an issue with your inputs.
_______________-
"If the Earth were a single state, Istanbul would be its capital." Napoleon Bonaparte
I don't know... the signals on the ports are TTL level, so it is pretty definite if it is a high or low on the port.
I have been digging around the code, and actually looked at the Assemble that PBP creates. After you work through all the macros and stuff some of the commands are LONG. A while loop command can be well over 20 instructions depending on the logical operator used. This sort of explains why the my code does not work when I use while:wend combinations. 20 instructions on the 18F8722 at 20MHz takes like 4uS to excicute... seeing how the signal I am looking for is only there 1 uS I can see how it will miss it...
As you have correctly surmised, trying to detect a 1uS pulse by polling a port pin is not going to be reliable.
Use an external (or pin change) interrupt instead and you will not miss any of these short pulses.
Bookmarks