Shop OBEX P1 Docs P2 Docs Learn Events
Propeller reset problems — Parallax Forums

Propeller reset problems

Dr_AculaDr_Acula Posts: 5,484
edited 2014-11-09 15:51 in Propeller 1
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?
«1

Comments

  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-18 21:10
    I haven't had the problem, but I think your analysis is correct. Add a 1K pullup, and maybe some capacitance, to nRST near the Prop, and I'll bet the problem goes away.

    -Phil
  • SapiehaSapieha Posts: 2,964
    edited 2013-05-18 21:10
    Dr_Acula.

    Search on forum for RC filter.

    I think You have similar problems

    Dr_Acula wrote: »
    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?


    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 Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-18 21:17
    Another thought: if you disconnect BOEn from Vss and connect it to Vdd instead, then add a weak pullup to RSTn, and the problem goes away, the noise is on Vdd, not RSTn.

    -Phil
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-05-18 22:21
    Thanks++. I'll make some changes to the next batch of boards I have made. :)
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-18 22:46
    Well, test it first! :)

    -Phil
  • jmgjmg Posts: 15,173
    edited 2013-05-18 23:24
    Dr_Acula wrote: »
    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?

    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 Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-19 00:15
    If you put a cap on the reset pin, with nBOE tied low, you may be risking damage to the Prop chip. The reason is that during a brownout (e.g. during power-up or power-down), the Prop will try to pull nRST low, but the cap will appear to be a momentary dead short to Vdd. If you must use a cap, put another resistor in series between it and nRST to limit the current during a brownout.

    -Phil
  • Cluso99Cluso99 Posts: 18,069
    edited 2013-05-19 00:25
    Try a 10K-100K pullup on the reset pin first.
  • Toby SeckshundToby Seckshund Posts: 2,027
    edited 2013-05-19 00:25
    I have had simular problems with my old oscilloscope, that results in a reset every time. I tried the pullup resistor (about 4k7 I think) as a part of the serial interface and experimented with caps but found that by the time something useful was gained on the /RST side I would then get problems on the programming side. Usually I stick a jumper in that line so that it becomes less suseptable and you get a useful option of not getting resets from the PC when you didn't want any.

    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.
  • jmgjmg Posts: 15,173
    edited 2013-05-19 03:20
    If you put a cap on the reset pin, with nBOE tied low, you may be risking damage to the Prop chip. The reason is that during a brownout (e.g. during power-up or power-down), the Prop will try to pull nRST low, but the cap will appear to be a momentary dead short to Vdd. If you must use a cap, put another resistor in series between it and nRST to limit the current during a brownout.

    -Phil

    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.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-19 09:52
    jmg wrote:
    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:
    Brown Out Enable (active low). Must be connected to either VDD or VSS. If low, RESn becomes a weak output (delivering VDD through 5 kΩ) for monitoring purposes but can still be driven low to cause reset.

    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
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-05-19 10:15
    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.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-19 11:21
    Tracy,

    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
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-05-19 16:37
    So maybe it isn't as simple as adding another resistor and/or a capacitor to the reset line?

    In which case... would another option be to use an NPN transistor to pull down the reset line?
  • RockyDRockyD Posts: 17
    edited 2013-05-19 18:09
    I have had some reset problems too. In my case it was a bread board that seemed to have one of the power wires wiggle out. So, only have the chip was getting power. After I fixed this the rest problems went away.

    Rocky
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-05-20 00:37
    I attached a 5kΩ pot to RESn (BOE to Vss, Vdd=3.3V). Reset occurs when the voltage on RESn drops below 1.5V. The Prop starts operating again when the voltage on RESn rises above 2.0V. So, there is a nice hysteresis band of 0.5V. However, I didn't see any artifact that would suggest feedback to RESn from the 50ms delay latch. That must take place entirely within the prop. So, I'll recant my notion about the 5k pullup being attached from the RESn pin to the 50ms delay latch.

    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.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-20 12:52
    Thanks, Tracy, for taking the time to do the analysis! Based upon your findings, I think if I were designing a new board, I'd tie nBOE high and use an open-drain supervisor chip on nRST. That way I could use a lower-value pull-up and pick a supervisor that gave me the desired voltage and timing characteristics.

    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
  • D.PD.P Posts: 790
    edited 2013-05-20 12:57
    I have had various luck with suppressing the mysterious (to me) propeller "reset" around any high voltage sources. Various filters/suppressors, completely different power supplies, isolated grounds, optocouplers, pull ups /downs... as suggested by this forum without luck so my "fix" was to move from a high voltage ignition source to a resistive ignition source for the device under propeller control. I appreciate all the effort by the forum to find the "complete" fix to this type of issue.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-05-20 13:10
    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.
  • jmgjmg Posts: 15,173
    edited 2013-05-20 13:10
    D.P wrote: »
    I have had various luck with suppressing the mysterious (to me) propeller "reset" around any high voltage sources. Various filters/suppressors, completely different power supplies, isolated grounds, optocouplers, pull ups /downs... as suggested by this forum without luck so my "fix" was to move from a high voltage ignition source to a resistive ignition source for the device under propeller control. I appreciate all the effort by the forum to find the "complete" fix to this type of issue.

    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.
  • jmgjmg Posts: 15,173
    edited 2013-05-20 13:11
    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.

    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.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-20 13:53
    I think that in brownout, the low that appears at RESn does not cause the reset.
    That raises an interesting question about the internal circuitry, then. Since the nRES appears to have the same output impedance driven high as driven low, this additional claim would imply a circuit like this:

    attachment.php?attachmentid=101713&d=1369083139

    But an external low on nRST will not reset the chip in that circuit. That's why I assumed this circuit was more plausible:

    attachment.php?attachmentid=101714&d=1369083139

    -Phil

    Addendum:

    OTOH, I guess it could be something like this:

    attachment.php?attachmentid=101715&d=1369083473
    394 x 173 - 1K
    413 x 160 - 1K
    433 x 173 - 1K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-05-25 00:58
    Quick update with some experiments. I had a wire connecting the reset pin to a switch on the front panel. Removing this wire fixed the problem. So I think this says that 20cm of wire on the reset pin is enough of an antenna to upset the propeller. For a solution, ? a transistor up close to the propeller chip, and that lowers the impedance and hence a wire going to, say, a 1k resistor on the base of the transistor is less likely to pick up RF interference?
    Or even a formal low pass filter on the transistor base?
  • jmgjmg Posts: 15,173
    edited 2013-05-25 01:23
    Dr_Acula wrote: »
    .. So I think this says that 20cm of wire on the reset pin is enough of an antenna to upset the propeller. For a solution, ? a transistor up close to the propeller chip, and that lowers the impedance and hence a wire going to, say, a 1k resistor on the base of the transistor is less likely to pick up RF interference?

    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.
  • ErlendErlend Posts: 612
    edited 2013-05-25 02:21
    Have you tried using a coaxial cable from the switch? For similar situations I use that, or at least I use a twisted pair of wires. For really hard-to-beat transients I also put a ferrite bead on the wires. I've done that to the V+ going to the MOSFET circuit that drives a HV spark circuit.
    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
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-05-25 09:01
    Some CPU supervisor chips, such as the MCP1322 (sot23-5), provide for an external pushbutton that is internally filtered to reject noise. The advice about avoiding antennas, or shielding leads, still applies as good practice. The MCP1320 (also sot23-5) includes a COP watchdog in addition to the pushbutton input.
  • zoopydogsitzoopydogsit Posts: 174
    edited 2013-05-25 15:21
    I recall in the dusty recesses of my mind that early model ATMs used to have a similar intermittent fault when the fluro light was turned on in the evening. I recall the fix was some spike suppressor caps on the AC side of the relay (you have to pick the values right to bypass a narrow spike and not AC.I thought they had a cap from the switched line to ground, for some reason 220pf comes to mind, but do some research before trying. And I have no idea what this would do for your ELCB! Someone else here with better AC power switching/filtering may better describe what caps you need and where. A simple test to prove this, would be to manually turn on the fluro and see if the prop resets. Or try a JR Turks store, they may have practical knowledge.

    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.
  • Tracy AllenTracy Allen Posts: 6,664
    edited 2013-05-26 17:05
    I'd promised to verify the brownout behavior of the reset pin. The red 'scope trace shows a pin toggling on RCslow as the power supply voltage is gradually reduced. BOE is tied to Vss, so the internal brownout circuit is enabled. The yellow trace is the voltage on the RST\ pin, and in this case, there is an external 4.7kΩ resistor tied to Vdd, so the resistor interacts with the internal ~5k pullup resistor. When the power supply drops below 2.7V, the internal reset goes low, the oscillation stops, and you can see that the voltage at the reset pin drops, not to zero, but to about Vdd/2. This verifies that the internal 5k is still there, but it is now connected to Vss instead of to Vdd. When the power supply again rises to 2.8V, the chip comes out of reset, and after the delay the oscillation recommences.

    prop1reset_boe2Vss.png


    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.

    prop1reset_boe2Vdd.png
    640 x 480 - 12K
    640 x 480 - 12K
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2013-05-26 17:36
    Thanks Tracy - very helpful information. And I agree re shielded cables - all very useful.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-05-26 18:51
    For the truly paranoid, this may be the ultimate extended-distance external reset circuit:

    attachment.php?attachmentid=101875&d=1369619497

    :)

    -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.
    546 x 266 - 4K
Sign In or Register to comment.