Shop OBEX P1 Docs P2 Docs Learn Events
Automatic Restarting — Parallax Forums

Automatic Restarting

MohammadMohammad Posts: 12
edited 2006-12-11 18:59 in BASIC Stamp
This is getting on my nerves and is killing me! I've been working on this for awhile now:

My BSII will just restart after doing the actions LookAroundYou and Aline
heres the code: www.geocities.com/name_here44/messenger.bs2.txt

Thanks in advance,
Mohammad.

Post Edited (Mohammad) : 12/11/2006 3:56:57 PM GMT

Comments

  • bennettdanbennettdan Posts: 614
    edited 2006-12-11 01:32
    What type of Board are you using the BS2 with? Your power supply may be pulled low with you operating the 2 servos and other stuff at the same time and reseting the BS2.
  • MohammadMohammad Posts: 12
    edited 2006-12-11 12:01
    Im using the boe-bot
    edit on the program too. now it goes to the turn point then restarts

    Post Edited (Mohammad) : 12/11/2006 12:49:13 PM GMT
  • allanlane5allanlane5 Posts: 3,815
    edited 2006-12-11 14:38
    This is a classic symptom of low battery. You aren't by any chance using rechargeable batteries?

    An alkaline battery gets 1.5 volts per cell, while a rechargeable (Ni-cd or Ni-mh) gets 1.2 volts per cell, when fully charged. 4 x 1.2 == 5 volts, which is close to the marginal edge of what the BS2 will run at. Any extra load (like a Servo activating) will reset the BS2.

    To detect this, put a:

    SEROUT 16, 16864, [noparse][[/noparse]"Did Reset", 13] at the start of your program. Then, every time it resets, you'll see the message on the 'debug' terminal.
  • MohammadMohammad Posts: 12
    edited 2006-12-11 15:42
    no its not the battires I've already replaced them before the first and fith run
  • bennettdanbennettdan Posts: 614
    edited 2006-12-11 15:53
    Sounds like a voltage drop to me if you have a anaolg volt meter you might see it happen.
  • MohammadMohammad Posts: 12
    edited 2006-12-11 15:55
    that's what I'm thinking now, so I'm asking for too much power right? how do I fix this?
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-11 16:27
    Another possibility could be a GOSUB stack overflow. You need to make sure that every GOSUB eventually results in a RETURN.

    It's always useful for you to post a circuit or at least describe what's connected to what.

    Sometimes it's not the average power drain, but the peaks that cause problems. Try connecting a 500uF or 1000uF 6V electrolytic capacitor across the 5V regulated supply to the Stamp.
  • MohammadMohammad Posts: 12
    edited 2006-12-11 17:09
    on page 252 of [noparse][[/noparse]link]http://www.parallax.com/dl/docs/books/edu/Roboticsv2_2.pdf[noparse][[/noparse]/link] + I have pizeospeaker hooked up on p4 and a Bicolor LED directly pluged in on p15 and p14 it said it took 5v so I didn't put a resistor
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-11 17:13
    Mike has a good point…Your main routine drops right into a subroutine causing a RETURN without GOSUB situation.


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • MohammadMohammad Posts: 12
    edited 2006-12-11 17:40
    Chris Savage (Parallax) said...
    Mike has a good point…Your main routine drops right into a subroutine causing a RETURN without GOSUB situation.
    What? Where? I checked that can you qoute that part?

    Thanks,
    Mohammad (so close to fixing it!)
  • Mike GreenMike Green Posts: 23,101
    edited 2006-12-11 17:46
    Just before the "Travel:" label, there is a RETURN and there's no corresponding GOSUB. Maybe you meant to put a STOP or a GOTO Main statement?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-12-11 17:50
    And that is also different from the original code you posted which didn’t have that RETURN and instead fell into the subroutine below which causes the same problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • MohammadMohammad Posts: 12
    edited 2006-12-11 18:59
    well that script didn't work so I'm gana try something else this seems quite pointless.
Sign In or Register to comment.