I have the following code for an 18f8722:
Occasionally it will randomly get stuck in one of the repeat-until loops. Any ideas on how to prevent this??Code:Low PortF.3
Low PortF.6
REPEAT
UNTIL PortA.5 = 0
High PortF.6
REPEAT
UNTIL PortA.5 = 0
Pauseus 1
Location1=PortJ
REPEAT
UNTIL PortA.5 =0
pauseus 1
CharLow=PortJ
REPEAT
UNTIL PortA.5 = 0
pauseus 1
CharHigh=PortJ
I have tried to add in a counter to jup out after so many loops, but that slows my code down so much that I miss the data on PortA.5.
Also if I use while:wend instead of the repeat:until this code does not work.