How to break out of infinite loop?

Accidentally created an infinite loop in my program. Now when I try to download a new version of our software, the Parallax IDE says "No BASIC Stamps found" since I'm guessing it is stuck running that infinite loop.

How do we stop it from running so we can update our program?

Board of Education USB, rev D.

For the record, the infinite loop is a "DO UNTIL (counter >= 10000)" where we forgot to increment counter inside the loop. And the loop contains a FREQOUT to the piezospeaker, so I can "hear" the loop running.

Comments

  • 4 Comments sorted by Date Added Votes
  • Accidentally created an infinite loop in my program. Now when I try to download a new version of our software, the Parallax IDE says "No BASIC Stamps found" since I'm guessing it is stuck running that infinite loop.

    How do we stop it from running so we can update our program?

    Board of Education USB, rev D.

    For the record, the infinite loop is a "DO UNTIL (counter >= 10000)" where we forgot to increment counter inside the loop. And the loop contains a FREQOUT to the piezospeaker, so I can "hear" the loop running.

    It might be a matter of timing your connection with the reset switch, but that's just a guess.

    Any com port in a storm.
    Floating point numbers will be our downfall; count on it.
    Imagine a world without hypothetical situations.
  • If you have a DEBUG statement in your loop, here is a link to a previous thread that may help. If you don't have a DEBUG statement, something else is going on that it cannot find the Stamp. Part of the downloading process is resetting the Stamp, so it being in a loop is not a problem.
    Re-inventing the wheel is not a waste of time if, when you are done, you understand why it is round.
    Cool, CA, USA 95614
  • Thanks for the replies. Not sure what happened there, we unplugged and re-plugged in the USB, and downloading a new application worked fine after that. False alarm! :)
  • GenetixGenetix Posts: 1,150
    edited December 2017 Vote Up0Vote Down
    I've never had a problem reprogramming the BS2 with an infinite loop program already running.

    Programming problems can occur if the program has a DEBUG statement at the start with no delay for the computer serial ports to stabilize.
Sign In or Register to comment.