Propeller reset problems
Dr_Acula
Posts: 5,484
I love the propeller! Recently I needed a pump controller and I needed it now. So - add a display, some A to D via the I2C bus and some relays and it is all working in under 2 hours. Put it in a case and I brought out the reset pin to a toggle switch on the front panel. However, it keeps resetting when electrical loads are switched nearby and I'm wondering if the reset wire (about 1 foot long) is picking up interference, and/or if the internal pull up reset resistor value is too high?
I have added lots of caps on the power supply (50,000uF electros, 33uF tant and a 0.1uF on every chip) and it takes ages to turn off when the supply is disconnected, so I don't think it is the supply. There are several wires coming into the box and one goes near a flouro light, and then inside the box these wires end up fairly close to the reset wires. Switching a 24VAC relay will occasionally reset the propeller. The coil is 3V3, but it is switching 24VAC. No common earth with the propeller circuit so this suggests inductive coupling.
The worst culprit for resetting the propeller is turning on a flourescent light, and given the heavy filtering of the supply, to me that suggests inductive/RF coupling.
Metal boxes and ferrite beads are one solution. However, before I do this, would adding a pullup resistor to the reset line (?1k to 10k) be allowed, or would this upset the timing of the startup circuitry?
Has anyone else had this problem?
I have added lots of caps on the power supply (50,000uF electros, 33uF tant and a 0.1uF on every chip) and it takes ages to turn off when the supply is disconnected, so I don't think it is the supply. There are several wires coming into the box and one goes near a flouro light, and then inside the box these wires end up fairly close to the reset wires. Switching a 24VAC relay will occasionally reset the propeller. The coil is 3V3, but it is switching 24VAC. No common earth with the propeller circuit so this suggests inductive coupling.
The worst culprit for resetting the propeller is turning on a flourescent light, and given the heavy filtering of the supply, to me that suggests inductive/RF coupling.
Metal boxes and ferrite beads are one solution. However, before I do this, would adding a pullup resistor to the reset line (?1k to 10k) be allowed, or would this upset the timing of the startup circuitry?
Has anyone else had this problem?
Comments
-Phil
Search on forum for RC filter.
I think You have similar problems
http://forums.parallax.com/showthread.php/145405-Help-With-Power-supply-Propeller-Resetting-when-other-tings-on-net-go-On-Off?p=1158230&viewfull=1#post1158230
-Phil
-Phil
Simple solution : Avoid the aerial on the reset pin.
For coupled spikes, a pull up will have less effect than a series resistor + cap, with the series resistor very close to the Reset pin.
Or, if you want even better immunity, choose something slow like a cheap opto-coupler, and use that
-Phil
On my PCBs I always stick a couple of 100n caps and a tant cap as close as possible (usually under the 40DIP) to the power ,/BOE, and by the /RST pins but the reset still creep in.
I have just made a Prop-in-a Box that uses 6AH of 12V (ish) Li-Po batteries and a 4" PAL/NTSC LCD that I had around the place (as a slightly more self contained "Lunch Box) I will see if that gets any resets whilst it is on/off external power etc.
Most uC with reset drive features on the reset pins, can tolerate a Cap connected, as the energy duty cycle is so low..
The prop data says RESn is a weak output, with a 5K pullup.
The "weak output" refers the to 5K high drive, not to the low drive, viz:
There is nothing in the datasheet to suggest that the low nRST drive during brownout is anything less than a full-on clamp to Vss via an nMOS driver.
-Phil
My understanding has been that the 5k resistor is connected to the output of the internal one-shot, the one that catches input pulses as short as nanoseconds and stretches them out to 50 milliseconds. Normally it is a 5k pullup, but during the 50ms delay it is a 5k pulldown. Weak on both ends. However, I don't recall how I arrived at that interpretation and I don't see anything in the docs to confirm it. Easy enough to test.
That might well be the case and, if true, it has grave implications for brownout resets if anyone attaches an external pullup <5K to nRST. IOW, in a brownout, nRST would not get pulled below its input threshold. This is clearly something the datasheet needs to spell out in more detail.
-Phil
In which case... would another option be to use an NPN transistor to pull down the reset line?
Rocky
Also, there is no feedback to RESn when the REBOOT command executes.
With regard to brownout though, RESn does become an active output. My initial results seem to confirm that the pulldown in brownout is not strong. If there is no external pullup in parallel with the internal 5kΩ, then when brownout occurs, the voltage on RESn drop instantly to zero. However if there is an external pullup, say 5k in parallel with the internal 5k, then when brownout occurs, voltage on RESn drops instantly only halfway to zero, then decreases gradually. That is consistent with the internal resistor going from being a pullup to being a pulldown. I have to check that again with a better setup where I have better control over the Vdd supply, better than simply pulling the plug. (Note too, this has to be done without an old-style prop-plug circuit attached, because that can supply parasite power to the Prop.)
It takes only a few nanoseconds at the RESn input to cause the reset. Not sure of the minimum, but you certainly don't want to introduce even the narrowest of noise pulses below the 1.5V threshold. It could come in on one of the signal wires too, without ever showing up on the power supply or RESn itself externally.
Clearly, adding a pull-up to nRST with nBOE pulled low is not going to allow reliable brownout operation. A cap, instead, might help, but you'd have to be very careful with the RC time constant, combined with the internal 5K, to be able to respond to power glitches short enough to affect a running program. An external supervisor chip gives you more design flexibility. Plus, they're tiny (SOT23 or smaller) and cheap.
-Phil
I think that in brownout, the low that appears at RESn does not cause the reset. It is an indication that the reset has occured internnally. So putting an additional pullup there, or an RC filter, should not be a problem for the actual initiation of the brownout. I need to run a couple more tests on it though at different power supply voltages. Might as well throw in data on what happens when BOE is high and RESn becomes a Schmitt trigger input.
I've used an external STM brownout detector+watchdog that draws only a couple of µA. The Prop supply current drops by that amount when you turn off its internal brownout.
I guess a good litmus test is to jumper short (SPCO) the reset pin, right at the device after start-up.
If issues persist, then reset-decoupling is not going to help.
In serious cases, you could expect DIP to be rather worse than QFN.
That is how most uC do reset-out.
The internal signal applies reset directly, and then drives the pin, so any Cap loads, do not delay an immediate kick in the pants.
But an external low on nRST will not reset the chip in that circuit. That's why I assumed this circuit was more plausible:
-Phil
Addendum:
OTOH, I guess it could be something like this:
Or even a formal low pass filter on the transistor base?
You want a slow responding, low pass filter.
Small FETs are cheap and they have high Cgs ( & Crs) that a series resistor can work with, to give a low pass action. That would give a shunt resistor as a switch wetting value, and a higher value (100K+) to the gate of the FET, and the FET and Rg are placed very close to the Prop Pin.
I highly recommend as standard practice to use coax (e.g. like those used for mic and earbud wiring) because you never know when there is an EMP around - or someone waving with a mobile phone.
Erlend
You still need to work out how to stop turning all of the Prop external connection leads into aerials. You'll need to do this to harden this outdoor/real world solution. Otherwise any electrical transmitter (CB Radio, vehicle starter motor, etc) will still cause you strange intermittents. I thought the ARL handbook had some points on this, if not shielded cables with the shield only grounded at one end, ferrite beads, metal enclosures, etc.
Good luck and let us know how you go.
The next diagram shows the effect of tying BOE to Vdd instead of to Vss. There is no internal reset and the Prop continues to operate down to 1V. Then it starts up again at 1.1V. Again, this is operating on RCslow, and you can see that clkfreq runs slower at the lower voltage.
-Phil
Addendum: For extremely long distances, the power over the cable should be regulated down to Vdd from a higher voltage at the switch location.