Power On Reset for 74HC595 -- BASIC Stamp BS2 using PBASIC.

Discussion in 'Embedded Systems and Microcontrollers' started by gmcmurry, Jul 15, 2015.

  1. gmcmurry

    Thread Starter Member

    Mar 29, 2010
    11
    0
    I have a circuit that operates several relays connected to a 74HC595. For those of you that have worked with the Basic Stamp, this is the output expansion example that Parallax has used for years.

    My problem is that the 74HC595 wants to come up with a pulsed high before it is initialized that closes the relays for a fraction of a second. I am trying to stop this.

    It occurred to me that he OE pin (13) of the 74HC595 could be held high for some length of time until the Basic Stamp sends it valid information, then the OE would go low and enable the output.

    Therefore, I thought I might make a simple RC that holds that pin HIGH for a bit, until everything stabilizes. Any reason i can't just tie Pin 13 (/OE) to +5 with a .1 cap and add a 10k resistor to ground? It should stay tied to +5 until the capacitor gets pulled to ground. Right?

    Is there anything wrong with this idea?

    This circuit is already on a PCB, so its not easy to experiment with. I will have to cut some traces, etc. That's why i need some advice.

    Greg
     
  2. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    Normally that kind of slow transition an input that is not a schmitt trigger causes problems, or at least is frowned upon. But if the inputs are stable in the off state before the transition starts, output bouncing will be invisible. I've done something similar many times. For a simple cut and jumper, I'd go for it.

    ak
     
  3. crutschow

    Expert

    Mar 14, 2008
    13,049
    3,244
    The /OE pin is just a level sensitive input so using the RC POE as you suggested should work fine, but note that this puts all the outputs in a high impedance state so, if you want the outputs to be in a definite logic state when /OE is high, then you will need to add a pull-down resistor at each output.
    What circuit are you driving with the outputs?
     
    Last edited: Jul 16, 2015
  4. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    With 0.1 uF and 10 K, the enable delay wil be less than 1 milliseconde. Is this enough to cover the bounce?

    ak
     
  5. cmartinez

    AAC Fanatic!

    Jan 17, 2007
    3,574
    2,545
    I concur with crutschow. A pull-down resistor is the way to go when you have indeterminate logic levels at startup. That's how I deal with them too.
     
  6. KeepItSimpleStupid

    Well-Known Member

    Mar 4, 2014
    1,147
    204
    20/20 hindsight

    Devices like the ULN2003 relay driver solve this problem inherently because for an open circuit (when the processor powers up as an input) is OFF, a low is OFF and a HIGH is ON.
     
  7. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    And the 2003/4, like many discrete power Darlingtons, have emitter pulldown resistors built in. That's the thing that solves the hi-z issue. Love that part.

    ak
     
  8. gmcmurry

    Thread Starter Member

    Mar 29, 2010
    11
    0
    I stepped away from this post for a few days and there is now great information here. Thanks everyone...

    I am using the ULN2003 darlington driver for my relays. I'll dive into this over the weekend. I will have to cut some traces etc, but if it gives me a more reliable power on, it will be worth it.

    Thanks again.
    Not at all -- I need to use about 10 uf. I wasn't thinking when I wrote that.
     
  9. eetech00

    Active Member

    Jun 8, 2013
    650
    112

    I recommend using the MR (Master Reset) Pin. The Master Reset is intended to be used to reset the 595, clear the registers and if held low, will prevent false shifting. The OE just enables/disables the outputs.

    Also, 10uF seems high, 1uf with 10K resistor should provide about 12ms delay.
     
  10. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    If you attach the circuit then it will be easy to understand what you are doing.

    The /MR pin was used for reset the internal D Flip flop and the /OE pin was used for turn on/off the internal output buffer, it just like as a switch to control the internal data of D Flip Flop, allow or not allow the data to output or not.

    The pin /OE was also used to control the multi chips with the same output, you can choose different 74HC595 chip via /OE to select, if you only have one 74HC595 then you can tie /OE to Ground that it will be selected all the time, you can refresh the /MR before the series data in.
     
  11. gmcmurry

    Thread Starter Member

    Mar 29, 2010
    11
    0
    I don't think my problems are with the actual registers, just the unknown output upon power up. If I can ignor the outputs while I set the registers, then enable the outputs after the registers are set, I should be fine.

    I was thinking about something like 100ms delay, but I can experiment with that when I get it hooked up. With relays, we like to do everything slowly.

    I have attached the section of the schematic. This circuit operates three groups of relays. Not shown are the 2 sets of ULN2803 Drivers and relays. They are on a different board that went straight to PCB so I never bothered drawing it up. Reminds me that I should. Its just what you think, the ULN2803 and 8 automotive style relays..

    The third set of relays are driven by onboard ZVN4206AV FETs. Nice devices if you have never used them. Use in place of 2N2222 (or other NPN Q) and skip the base resistor. Built in diode, etc. Made for specifically driving relays in an open collector manner. I built the board to use a base resistor and an NPN Q but I ended up using the ZVN4206AV FET instead so the base resistor 0 ohm. I attached that data sheet if anyone is interested.

    Greg
     
  12. AnalogKid

    Distinguished Member

    Aug 1, 2013
    4,546
    1,252
    Looks like the LEDs are backwards.

    ak
     
  13. ScottWang

    Moderator

    Aug 23, 2012
    4,855
    767
    You used 74HC595, but was not for led multiplex display and the /MR was tied to +5V, so you have to send three zero(3 bytes or 24 bits) to three 74HC595 for the initial clear as the power up reset, and then when you want to send the data out, you should send three numbers of data, they are 3 bytes or 24 bits each times, that is a cycle for your applications.
     
  14. gmcmurry

    Thread Starter Member

    Mar 29, 2010
    11
    0
    Yes, they are drawn that way -- its a mistake/typo. The LEDs work just fine. Thanks for pointing that out.

    Ill have the schematic fixed by the time the ink is dry on this post.

    Greg
     
Loading...