View Full Version : bs2p24 will not reset w/power reapplied unless reset button.
01-26-2006, 12:32 PM
Well , like the subject says, bs2p24/USB demo board will not reset (start· running program from beginning) when power has been removed and reconnected power unless reset button is pushed or its reprogrammed.
Shouldn't removing power always make it just like pushing reset ?
The clue might be that this only happens after it's run through all of it's code and come to an "end". If you power off/on before it gets to the "END", then it will reset/start over.
There is no eeprom.
I have made sure the power LED actually goes out.
I have tried disconnecting any possible sources of feedback/stray power that might be keeping it powered up at the "end" line.
I have tried letting it set for 15 minutes or so to get it fully powered down.
·Thanks to all !
01-26-2006, 02:07 PM
Do you have anything connected to the I/O pins that is powered separately?· Also, what do you mean there is no EEPROM?· The BS2p24 has one on-board where your program is stored.· Speaking of the program, you should attach it so we can get a look at what's happening.
Parallax Tech Support
01-31-2006, 01:09 PM
OK, I finally got back to it.Tonight I ran it through the program, cutting off power randomly·then reconnecting and it always restarted UNLESS I let it run to the "END". Then it would not restart/reset. I disconected everything one-at-a-time
and powering up after each diconnected item....still nothing. Last step was to diconnect everything from the board, so nothing but the "USB board" with the stamp on it, then reconnect USB, check loopback on bebug, reconnect power.....nothing...push reset button and away it went (started prog.).
Prior statement "no EEPROM" meant no external memory.
As for posting my program, I prefer not to unless absolutely needed.
Please help. Thank you!
01-31-2006, 01:32 PM
What happens if you replace the END statement with STOP?
Parallax Tech Support
01-31-2006, 09:56 PM
When the BS2 gets to 'END', I believe it goes into a low power mode. In low power mode, it could take quite some time for all voltage sources to go to zero. It's even possible that your RS-232 interface (on the 'far end' of the USB cable) could be powering the chip sufficiently in low-power mode. Thus the chip is never completely 'off'.
In the other run modes, the chip does pull a few milli-amps -- enough to draw down any supplies to zero. That's why Chris suggests the 'Stop' instead of the 'End'.
Now, perhaps you WANT that 'low-power' mode. Hmm. Tricky. I'll have to think about it.
01-31-2006, 11:07 PM
Allan also brought up another point I hadn't got to which is about the Serial Cable.· I didn't mention this since you said your board is USB, but the power supply thing is definately suspect, and we have seen this before.
Parallax Tech Support
02-01-2006, 11:41 AM
It is a USB board w/no serial adapter to laptop.
Also ,like I said, I had disconnected everything.
I don't know why I didn't try this earlier.........With it acting-up (not reseting), I powered-down, removed the stamp from the board, reinstalled and powered-up...still nothing.
Then Replaced the "END" with a "STOP" ....fixed the problem.
Each of these steps were repeated to confirm results.
Now does this mean I can never use "END"??
Post Edited (lightsout) : 2/1/2006 3:24:54 PM GMT
02-02-2006, 12:42 AM
·· I spoke with our Senior Software Engineer on this and he had the following to add to my findings:
The Stamp is working exactly as it's supposed to, in this case, but the circuit is keeping it from working as desired.
The board that you have the BS2p24 connected to (USB BOE, right?) has two power capacitors on it to condition the power going into the board and also going into the BASIC Stamp.· If the program simply ends at some point, or if the program has an actual END statement that it reaches, the Stamp goes into low power mode where it drops it's power consumption by more than 10 times (typically) and it basically goes to sleep, however, it's really taking more of a "nap" than a solid sleep; ie: it wakes up periodically (every 2.3 seconds) and then decides it needs to go back to sleep.
So, in this state, it is drawing upwards of 10 times less power per interval than it did during norming running... disconnecting all power sources will cause the capacitors on the board to drain into the Stamp until they are depleated, but that will take much longer now since the Stamp is consuming much less power.· The result is, short power disconnections (I mean on the order of a few seconds to a minute or so), will result in the Stamp continuing to have enough power to maintain its sleep state, and when power is connected back in, the caps charge back up to full and the Stamp never even realized that any power fluctuation occurred at all because the caps maintained a higher-that-brown-out voltage, so it continues to sleep, or "nap" if you will.
The reason that the STOP command causes it to behave differently is becuase the STOP command is similar to:
····· GOTO WaitHere
Here, as with the STOP command, the Stamp is running at full power, and constantly executes a command, so removing the power source causes the caps to drain much quicker, leading to the Stamp reaching it's brown-out trip voltage (about 4.2 volts DC) much faster, and actually going into shut down mode.
If you need to have the program/Stamp quit until a power-cycle or reset, and you're using the USB BOE or a similar board or a circuit with similar power filtering (capacitors) on it, then you'll have to use a STOP command in place of any END commands in order to prevent this issue.· One other possibility, if you were using your own pcb, is to utilize the third prong on most power jacks (which is connected only when a power plug is not inserted) to have it drain power from the caps through a properly sized resistor, so that even when the Stamp is in low power mode and the power is disconnected for a very short time, the caps will drain beyond the brown-out voltage level very quickly.
Parallax Tech Support
02-02-2006, 01:15 AM
Yes , this is the USB BOE. I don't understand how any of this relates to the fact that even removing the stamp from the board (for up to a minute so far), will not make it reset.
I still have your other tests to try, but none of those tests address how "stamp removal" doesn't reset.
02-02-2006, 01:48 AM
When you remove the Stamp·from the board, the caps should still have power.· When you plug the Stamp back in, it should start the program from the beginning... is it possible that it actually ran and completed the program before you had time to plug in power and see the rest of the circuit in action?· How are you determining that it never ran the program all the way through from the moment you plugged the Stamp back in to the moment you powered back up?
Parallax Tech Support
02-02-2006, 04:58 AM
Chris Savage (Parallax) said...
... is it possible that it actually ran and completed the program before you had time to plug in power and see the rest of the circuit in action?· How are you determining that it never ran the program all the way through from the moment you plugged the Stamp back in to the moment you powered back up?
I takes about a minute to get to the "end".
I am determining it never ran the program based on no servo action or debug info,debug screen can always be verified by pushing reset button and seeing program run.
I have also found that placing "end" at first part of program causes the same problem.
Stamp pins #21 & 22 are staying at·aprox. 1.5volts·(very slowly dropping) even when absolutely everything is unplugged from board. Shorting out #21 & 22 before powering up allows normal operation.(I took my chances that it was OK to do that).
When voltage is present on pins #21 & 22 and stamp is not reseting, I can remove stamp, measure voltage at board socket and get close to zero volts on··22 and close to 1 volt at 21.
Is it possible to have a stamp voltage leak from VCC to RES ??
Remember, it only is having the problem with the·"END" statement. Using·"STOP" or using the following allows normal operation.
· DEBUG “PROGRAM ENDED!”, CR
· PAUSE 150
· GOTO TestLoop
02-02-2006, 06:09 AM
It turns out it's VERY difficult to get a reliable 'brown-out-reset-circuit' to work when the voltage drops very slowly -- as it does when the BS2 is in 'END' state.
You haven't mentioned if the additional power-draw of the 'STOP' command is a problem for you or not. Assuming it is, one other thing you might try is a 100 KOhm resister between the BS2's VDD and VSS pins. During normal use, this will pull an additional 50 micro-amps of current from your supply, which shouldn't be a problem. When the supply goes down, this resistor should give you a path to ground to insure the BS2 resets when power comes back up.
Another alternative is a:
The idea here being that in 'sleep', the BS2 uses as much current as in 'END', but then it tries to 'wake up'. When it tries to 'wake up', it should pull enough current to give you a hard 'zero volts' condition, which should force a reset when power comes back.
The assumption being here in 'pause' it won't pull much current
02-02-2006, 06:11 AM
It's even possible that, in the low-power mode, the BS2 is picking up enough RF energy from the air (60-hz flourescent lights, mostly) to prevent that hard 'zero-volts' condition.
Or, that it would take as much as a minute for the BS2 to 'self-discharge' enough to enable the brown-out reset circuit.
02-02-2006, 11:16 AM
OK, now I am really down to the basics.
MY PROBLEM IS THE USB/BOE "HOLDING POWER".
I must have super caps or something !
I have swaped bs2p24 stamps with the other one on this project and only have the following program on both:
·The other board is a serial/BOE and that resets normal with no problem.
And only the USB/BOE board will not reset with power disconnected.
Absolutely everything is diconnected from the board, I even manually unplugged the power wire and USB·from the board ,reconnect ,re-identify ,power-up·as I have before with the other tests.
Sitting powered down for over 15 minutes doesn't do it.
Anyone else have this problem with the USB/BOE boards?? Is this really the first time this has come up ?? Don't most people want to start thier program without having to open up thier project box and pushing the reset or reprograming every time ?? Is my USB/BOE board somehow defective ??
I want the low power when not running the program, however during the program it doesn't matter.Maybe allanlane5's current draining resistor would work, but then defeats the low power idea I think.
I've got about 10 hours into this problem and I feel like this:http://forums.parallax.com/images/smilies/freaked.gif
02-03-2006, 04:40 AM
I believe if you "identify" your BS2, it SHOULD go through the USB/RS232 reset cycle, so at least you won't have to open your case to get the program to run.
I can't tell from your posts, but the question is, if you DON'T have the USB cable connected, and you then pull power, and you then reconnect power, does your BS2 reset?
And what happens if you do use the 'sleep' loop above?
Oh, and if you open a 'debug' port (those little icons to the top right of the IDE) that should also send a 'reset' to your BS2.
02-03-2006, 08:24 AM
·· Here's the deal.· If you look at the schematic for the current revision BOE you will find that the Vcc (not Vdd) pin on the BASIC Stamp is connected to a 1000 uF capacitor.· This pin is not normally connected to anything else on the BOE.··There are two capacitors just below the battery snaps.· One (the right one) belongs to the regulator and the other (the left one) is the one connected to the Vcc pin.· When you power down the board there's really nothing to discharge this capacitor very fast, so what happens is that it gets down to about 1V and floats there for quite a long time.· This capacitor is designed to protect the Stamp Module from browning our when running from a battery pack by keeping the Vcc circuit charged when Vin sags.· When the BASIC Stamp is in SLEEP mode the brownout detection is disabled and therefore the Stamp Module doesn't know that there has been a brownout condition.· So, when you power the circuit back up it picks right up where it left off.
·· The bottom line is this.· If you insist on using END statements in your program then you would need an external brownout chip such as the 13811 to handle your power down conditions.· Otherwise you will need a board that doesn't have this 1000 uF capacitor on the Vcc pin.
Parallax Tech Support