74HC595 all outputs go ON randomly at startup

hi everyone
74HC595 all outputs go ON randomly at startup
how can i from the Sketch make sure that all outputs of the 74C595 are OFF

Hi, @hosninfogate. Why don't you just turn off all the outputs of the 74HC595 at the very beginning of your program?

do you mean in the setup or loop?

I'm sure @flashko means very first thing in setup

1 Like

Yes, exactly. However, there will be a small delay after power up, which depends on the bootloader and the microcontroller. If time is critical you can try a microcontroller without the bootloader because in this case there is almost no delay. Or maybe somehow use the hardware MR (master reset) pin of the 74HC595 on power up!? It's just an idea.

1 Like

Pin 10 on the 74hc595 is MR (Master Reset, active LOW). If you hold it LOW at startup, it will clear all Outputs. Do it with a 100nF to GND and a pull-up 47K resistor to Vcc. This gives a 3ms delay (MR stays LOW 3ms and then goes HIGH) at power up. Increase the capacitor value if you need more.

I think that will set all outputs low reliably; the OP will have to decide if that is desired, as, for example, many relay boards are low-active.

No it only clears the shift registers, not the output latches

Oops, you're right and I don't see any easy hardware way to reset the outputs at power-up.

(not so) funny story from my first job. We used to sell a relay board for our proprietary bus system that could be controlled from a PC. We had a customer who built roads and used the first version of the board to control actuators that would drop asphalt on the road bed.

The board used a 74LS273 and a ULN2803 driver to run the relays. The engineer who designed it didn't think about the reset state and left RESET floating. Which led to an annoyed call from the customer about why the system was randomly dumping hot asphalt sometimes when they powered it on.

Kevin, if you're reading this, sorry but I smile every time I remember the story!

If you pull /OE high with a resistor then outputs will remain high impedance until /OE is actively pulled low. High impedance outputs will rarely affect anything.

So whatever it's connect to will be floating.

If the startup level of whatever it is connected to is important, it can be dealt with with pull-up/down resistors. Any fluctuations of the '595 will not be relevant though.

  • We need to see the circuit schematic so we can confirm proper design has been followed.
1 Like

I worked on a product that to quit starting in sequence with every advance in computer speed. The interim solution was to put a delay IC on the "system ready" line and massage the code to wait for the signal. Maybe that three-leg IC still exists?

... (story con'd)... after a month of digging through the original engineers reference material, I found Atmel had changed "always on" and "system on" pin assignments. The original engineer did not like that I asked for a product-wide design change, but my department bought a module and implemented the change. My first customer was the university who "google mapped" the roads of their province before google existed. They bought "my salary" worth of boards that day and put a future order for ten times my salary every year. I made a visible bump on the profit chart. However; what happens when you solve a decade-old problem is that you do not have that problem any more. The bean counters saw "nothing" coming from my department (technical development and support), so the original engineer, his secretary and I were released. That's how tech support should work: solve problems, not symptoms. The engineer went on to support a radio relay station in Peru, brought his family after language immersion, and lived there for nearly twenty years until the children wanted to see the rest of the world and they wanted to be with family.

Bruce; I keep smiling for getting you fired.

1 Like

It could be that all the '595 outputs default to LOW on startup. But then the clock, data and latch pins float for some time as the Arduino bootloader waits for a possible code update, and then your code starts running and sets the pins connected to clock, data and latch to outputs, so they go longer float. But by then the '595 has already loaded a bunch of random data.

Try a 10K pulldown resistor on the latch pin, maybe the clock and data pins also.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.