Getting Stuck in loop


Results 1 to 23 of 23

Threaded View

  1. #1
    Join Date
    Aug 2008
    Posts
    39

    Default Getting Stuck in loop

    I have the following code for an 18f8722:

    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
    Occasionally it will randomly get stuck in one of the repeat-until loops. Any ideas on how to prevent this??
    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.
    Last edited by Frozen001; - 14th November 2008 at 16:29.

Similar Threads

  1. Controlsystem for compact sporting (clay shooting)
    By Fredrick in forum mel PIC BASIC Pro
    Replies: 11
    Last Post: - 30th July 2009, 16:48
  2. Avoiding getting stuck in a loop
    By AndrewC in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 31st July 2008, 11:41
  3. Serin to Serin2 ??
    By Gixxer in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th January 2008, 03:56
  4. Serial Relays
    By tazntex in forum General
    Replies: 3
    Last Post: - 17th May 2007, 17:42
  5. Newbie question:
    By Izone in forum mel PIC BASIC
    Replies: 2
    Last Post: - 26th February 2006, 16:24

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts