Shop OBEX P1 Docs P2 Docs Learn Events
Reset Button not working — Parallax Forums

Reset Button not working

Claire_DrexelClaire_Drexel Posts: 4
edited 2012-07-22 03:34 in BASIC Stamp
I have written a program for my double switch circuit to change power supply between LOW, HIGH, and OFF, but my reset button on the Stamp won't work. I have to plug the stamp into the computer and unplug it each time to get it to run. And then, I'm not even pressing the button. After plugging it in and unplugging it, the program just starts. When it's done running, I press the reset button to do the cycle once again, but it does nothing. How can I fix this so I can use my reset button and don't have to keep plugging the computer in every time?

Here's my code:

PAUSE 1000

LOW 1 'switch to HIGH voltage on top relay
HIGH 0 ' switch bottom relay into ON position
PAUSE 3000 'HIGH voltage supplied for 3 seconds

LOW 0 'switch bottom relay into OFF position
PAUSE 2000 'pause in OFF position

HIGH 1 'switch to LOW voltage on top relay
HIGH 0 'switch bottom relay into ON position
PAUSE 3000 'LOW voltage supplied for 3 seconds

LOW 0 'switch bottom relay into OFF position

END

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2012-07-17 09:14
    The Reset button either works or the button or its connections are broken somehow. Connecting the RST pin of the Stamp to ground is functionally identical to turning the power off, then on. The only way there's a difference between grounding RST vs. turning the circuit off and on would be if you have other ICs connected to the Stamp. In that case, the Stamp gets reset in either case, but the external ICs get reset only when the power is turned off, then on.

    You might put a LOW 0 and LOW 1 before the PAUSE 1000. It should be optional since the Stamp's I/O pins are put into input mode on a reset, but it's good programming practice to set I/O pins to an initial state (if not input) at the beginning of a program.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-07-20 10:28
    This is a rather unusual failure. But if this is a Homework board, you might spray the reset button with some electrical contact cleaner to restore it's function. It is a bit difficult to believe that the microcontroller or anything else failed unless there was quite a bit of abuse. The push buttons do fail with age and dirt, but the cleaner restores many of them.

    The contact cleaner comes in a spray can and is handy for just about any test equipment with knobs and switches. I use a German brand that is called "Kontakt".

    Alternatively, you could short the Vin to Vss and have the Brown Out circuit inside the microcontroller reset the device. But this is technically a rather brutal way to doing a Reset.

    Or another alternative is to install a switch that momentarily breaks the supply circuit. I suppose that might be found at Radio Shack or some place similar.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-20 10:55
    I could just be a flaky button. I have a BOE whose reset button I must've worn out. If it press it to the point where I get the usual tactile feedback, nothing happens. But if I press it really hard, it makes contact.

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-07-20 12:18
    I suppose one could remove the button and solder a new one in place. My Homework board has a surface mount one that wouldn't be too hard to replace.

    It looks like the Brown Out Reset is an add on chip on this version as the PIC16F57 did not include an internal brownout feature. The SX chips have an internal brownout control.

    The main thing is that the BasicStamp is programming correctly. The ATN signal also uses the Reset and if that works the micro-controller is A-Okay. In fact, I am almost 100% sure that if the device will take programs, it has to be a faulty button. The pull-up resistor is intact.

    Momentarily shorting the Vin and Vss should trigger a brownout event. If one wants to be conservative, use something like a resistor to do the job. That would limit the current. Not sure about what value though.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2012-07-20 19:40
    Alternatively, you could short the Vin to Vss and have the Brown Out circuit inside the microcontroller reset the device. But this is technically a rather brutal way to doing a Reset.

    Momentarily shorting the Vin and Vss should trigger a brownout event. If one wants to be conservative, use something like a resistor to do the job. That would limit the current. Not sure about what value though.

    Why not just open and close the connection between the battery/source and "Vin"?
    Not enough sparks?
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2012-07-20 20:15
    PJ Allen wrote:
    Not enough sparks?
    LOL! Classic PJ! 'Made my day. (I''ll bet one of his high school yearbook entries was, "Stay satirical, and never change." :) )

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2012-07-21 08:29
    Rather than needing the reset at all, one could have the program wait for a BUTTON input to loop again through a cycle. One way or another, it seems that someone will have to go to the store and buy some sort of a switch or clean up the reset button.

    I did say that shorting option was 'rather brutal'. I don't like to think about what it might do the voltage regulation chip.

    If one has the WAM kit, there are a couple of push button switches included that be pressed into use inside the program OR one might drag out the soldering iron and replace the defective one. Just test it before you begin taking your board apart.

    I still think aerosol spray cleaner is the best approach.
  • IroneIrone Posts: 116
    edited 2012-07-22 03:34
    Hello Claire

    A reset button is a very simple piece of equipment. In this case it is a normally open momentary switch which closes when you push it. Do you have or can you borrow a multimeter that has a resistance reading or a setting that beeps whether the circuit is open or closed? If you can you must turn your BS2 upside down with the battery in the lower left corner to check it out. Just left of center and about 1/5 of the way down you will see a rectangle of dots. Do not turn the power switch on and use the probes to just check if the left two dots are open or a high or OF reading.(they should be, plus and minus on the probes does not matter) Then with the probes in the same position press the button. If you get shorted or a beep or a very low resistance reading your button works. If this checks out and your button still does not work you may have a mistake in your wiring or program. One last thing to check is the lead between the lower left button and the pin it is connected to on the BS2 module. Make sure that it has not been scratched or marred which would affect the signal from the button.

    Please keep entering programs! There is a lot of help here if you just make a try and there is a lot you can do with this little microcontroller.
Sign In or Register to comment.