I am using a PIC 18F8722 micro to interface an older piece of equipment.

Here is the code I am using to test the proper read of some data:

Code:
while Counter1 <200
If PortA = $0B then
	Toggle PortB.0
endif

If PortA = $0C then
	Toggle PortB.1
endif

If PortA = $0D then
	Toggle PortB.2
endif

Counter1=Counter1+1

wend
The pic clock and the equipment clock are operating at different speeds, I think the pic is 2-4 times faster and not in sync with the equipment I am trying to interface to. The problem I have is that I cannot always read the data. I sometimes miss some of the correct conditions. Any thoughts?