Shop OBEX P1 Docs P2 Docs Learn Events
Basic Stamp 1 Project Board problems — Parallax Forums

Basic Stamp 1 Project Board problems

ExigeExige Posts: 11
edited 2006-11-02 00:28 in BASIC Stamp
Hello, recently I bought a Basic Stamp 1 Project Board. I have been testing it and experimenting with it a lot.

The problem is that it shuts down and I can't start it so easily after that. I wrote a program than receives signals from a remote-control and I am using it for turning lights on and off. But when I leave the Basic Stamp running the program over night it shuts down or crashes or something. The red light that indicates that it is on doesn't lit either.

Now I wonder why The Basic Stamp 1 shuts down/crashes?

(Sorry for my bad English)

Post Edited (Exige) : 10/30/2006 8:11:08 PM GMT

Comments

  • AmaralAmaral Posts: 176
    edited 2006-10-30 20:10
    Exige

    Please , try to give us more information. Try posting a sample of your conections and your code. will be much easier to help.

    Amaral.
  • ExigeExige Posts: 11
    edited 2006-10-30 20:20
    Here is my code.
    ' {$STAMP BS1}
    SYMBOL irpulse = W2
    SYMBOL remotecode = B0
    SYMBOL timer = B2
    SYMBOL effekt = BIT8
    HIGH 6 'Gives power to the Ir-sensor
    
    irstart:
    PULSIN 5, 0, irpulse
    IF irpulse > 80 THEN loop
    'Thigns to do all the time.
    PULSOUT 3, 1000
    IF effekt <> 1 THEN irstart
    timer = timer + 1
    IF timer = 1 THEN led1on
    IF timer = 2 OR timer = 6 THEN led2on
    IF timer = 3 OR timer = 5 THEN led3on
    IF timer = 4 THEN led4on
    GOTO irstart
    
    loop:
    remotecode = 0
    
    HIGH 3
    PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c1
    BIT0 = 1
    c1:PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c2
    BIT1 = 1
    c2:PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c3
    BIT2 = 1
    c3:PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c4
    BIT3 = 1
    c4:PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c5
    BIT4 = 1
    c5:PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c6
    BIT5 = 1
    c6:PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c7
    BIT6 = 1
    c7:PULSIN 5, 0, irpulse
    IF irpulse < 100 THEN c8
    BIT7 = 1
    c8:LOW 3
    
    'DEBUG remotecode
    'Things to do if a button on the remote-control is pushed.
    IF remotecode = 138 OR remotecode = 203 THEN ledoff
    IF remotecode = 26 OR remotecode = 155 THEN ledon
    IF remotecode = 150 OR remotecode = 215 THEN oneledon
    IF remotecode <> 78 AND remotecode <> 206 THEN irstart
    effekt = 1
    GOSUB beep
    GOTO irstart
    
    beep:
    SOUND 2,(63,10)
    SOUND 2,(111,10)
    RETURN
    
    led1on:
    HIGH 0
    LOW 1
    LOW 4
    LOW 7
    GOTO irstart
    
    led2on:
    HIGH 4
    LOW 0
    LOW 1
    LOW 7
    IF timer <> 6 THEN irstart
    timer = 0
    GOTO irstart
    
    led3on:
    HIGH 1
    LOW 0
    LOW 4
    LOW 7
    GOTO irstart
    
    led4on:
    HIGH 7
    LOW 0
    LOW 4
    LOW 1
    GOTO irstart
    
    ledon:
    HIGH 0
    HIGH 1
    HIGH 4
    HIGH 7
    effekt = 0
    GOSUB beep
    GOTO irstart
    
    ledoff:
    LOW 0
    LOW 1
    LOW 4
    LOW 7
    effekt = 0
    GOSUB beep
    GOTO irstart
    
    oneledon:
    LOW 0
    LOW 1
    LOW 7
    HIGH 4
    effekt = 0
    GOSUB beep
    GOTO irstart
    



    The program is working very good, but when I leave the Basic Stamp 1 running it over a night the red "Power" led doesn't lit. I don't think my connections is the problem just because i works fine for many hours.
  • ExigeExige Posts: 11
    edited 2006-10-31 10:15
    Today I disconnected everything from the board and measured the power consumption. Both my multimeter's says it draws about 60 mA with the following program:

    ' {$STAMP BS1}
    LOW  0
    LOW  1
    LOW  2
    LOW  3
    LOW  4
    LOW  5
    LOW  6
    LOW  7
    END
    


    That must be the problem? The basic stamp 1 project board technical specifications say it should draw about 5 mA in sleep mode and 7 mA running. Is the board defect?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-31 15:14
    Hello,
    ·
    ·· Where (at what point) are you measuring the current, before or after the voltage regulator?· Or are you feeding voltage into VIN?· I take it this program downloads okay?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ExigeExige Posts: 11
    edited 2006-10-31 15:20
    Before the voltage regulator. Yes the program downloads okay and is working okay for som time, but not over a night (6hours+).

    Vin is before the regulator and Vdd is after?
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-31 15:27
    Sorry for the confusion…If your circuit has it’s own regulator then it will use some current as well, thus measuring current before it will be the current draw of the BASIC Stamp and the Regulator.· How are you powering the BS1?· Where is your power source connected?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ExigeExige Posts: 11
    edited 2006-10-31 15:33
    Thanks for the quick answer!

    My power source is a 9-volt battery. I don't think the regulator should take so much current...
    450 x 600 - 82K
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-31 15:44
    Okay, you’re correct…Using the on-board regulator there should be so much.· So how much current draw do you see if you run the following program?
    ' {$STAMP BS1}
    ' {$PBASIC 1.0}
    Main:
      GOTO Main
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ExigeExige Posts: 11
    edited 2006-10-31 16:03
    Chris Savage (Parallax) said...
    Okay, you’re correct…Using the on-board regulator there should be so much.<SPAN style="mso-spacerun: yes"> So how much current draw do you see if you run the following program?
    ' {$STAMP BS1}
    ' {$PBASIC 1.0} 
    Main:
      GOTO Main 
    
    

    About 62 mA.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-31 16:31
    Perhaps there is a problem then.· I just tested my board and I get .006A when running your original program and .005A when running the one I posted.· Seems strange that it programs fine though.· I wonder if all the I/O pins work properly?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ExigeExige Posts: 11
    edited 2006-10-31 16:45
    Yes all the I/O pins works fine. And I think 0.006A that you get is right. The question is what it is that draws so much current on my board. confused.gif
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-31 16:52
    Could this be a problem with your meter?· Do you have a way of testing a known current load to compare?· One way to create one is to make a voltage divider between a known voltage and ground and measure the middle of the divider.· What is your meter displaying exactly?·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ExigeExige Posts: 11
    edited 2006-10-31 17:01
    Thanks again for your help!

    I wish my multimeter was faulty but sinse I have two different multimeters there is little chance that both would display the wrong current. For example one of my multimeters is displaying 0.062A.
  • ExigeExige Posts: 11
    edited 2006-10-31 18:44
    Now I have occurred a strange thing… I tested to measure the current when I connected it to a 5 volt power supply and then the current was not more then 7 mA :S

    So now I have two questions:

    How could the current draw be about 10 times more on a 9 volt battery? (The 9 volt battery is actually rechargeable, if that makes any difference.)

    And why can’t (my) basic stamp 1 project board be running more than a few hours before it stops/shuts down/crashes?

    I am very grateful to any answers.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-10-31 23:42
    Hello,
    ·
    ·· You listed a specific program that this is happening.· If you write a simple program to blink an LED does the Project Board stop running then?· Try a simple loop that runs continuously and blinks and LED and see what happens.·

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ExigeExige Posts: 11
    edited 2006-11-01 06:07
    Okay I will try that with this simple program then:
    ' {$STAMP BS1}
    Loop:
    HIGH 0
    PAUSE 1000
    LOW 0
    PAUSE 1000
    GOTO Loop
    


    But I don't see why my program that remote controls leds stops running after some time.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-01 20:16
    I suggested a simple program because without following every line of your program I cannot be sure there isn’t a line that does something like RETURN without a GOSUB, GOSUB without a RETURN, etc., something that could cause the program to crash after some time or overflow some variable.· By running a simple program with no calls or end you can narrow the problem down to your code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
  • ExigeExige Posts: 11
    edited 2006-11-01 21:58
    The Basic Stamp has been running the simple program I posted previously fine today. So the problem is likely my original program. I will try to find any bugs.

    Thank you Chris for helping me [noparse]:)[/noparse]
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2006-11-02 00:28
    No problem…I would start tracking the flow of the code now to see if at some point the code is doing something you don’t intend.· Good luck.· You may want to break it down into simpler chunks.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support
Sign In or Register to comment.