Shop OBEX P1 Docs P2 Docs Learn Events
How to break out of infinite loop? — Parallax Forums

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

  • 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.

  • 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.
  • 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,742
    edited 2017-12-27 19:40
    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.