Go Down

Topic: quiet start-up for shift register? (Read 957 times) previous topic - next topic

kmwkmw

I have an arduino connected to a 74HC595 shift register, similar to the set-up in this tutorial (http://bildr.org/2011/02/74hc595/).  The output pins of the shift register are connected to some relays.  Output pin high sets relay off; output pin low sets relay on.

My problem is that when I start or reset the arduino, the relays chatter rapidly for a second or so.  I would like to avoid this.

What is the best way avoid fluctuations in the shift register output pins when the arduino is starting up?  I've tried writing to the shift register in the arduino setup() function, but that doesn't seem to be soon enough.  I'm using digital output pins 8, 9 and 10 on the arduino to control the shift register.  Would I have better luck with different pins?


CrossRoads

Only sure way is to control the output enable pin also.
Pull it high with 10K resistor, and pull all the outputs high also.
When your sketch starts up, don't drive output enable low until you have shifted 1's in and are ready to start driving the outputs high or low.
Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

magagna

How about - instead of tying OE to ground, connect it to an IO pin (any free Arduino pin) and a 10K pullup resistor.

The pullup resistor will keep OE high until you're ready for it, and when OE is high on a 74hc595 its output pins are in high impedance (disconnected).

When your startup & config code is done running in your Arduino sketch, do digitalWrite(yourPin, LOW) to enable the 74hc595's output pins, and away you go.

Good luck!
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

kmwkmw

Thank you the quick and helpful answers.  I had tried controlling OE; what I was missing was the pull-up resistors.

Hippynerd


How about - instead of tying OE to ground, connect it to an IO pin (any free Arduino pin) and a 10K pullup resistor.

The pullup resistor will keep OE high until you're ready for it, and when OE is high on a 74hc595 its output pins are in high impedance (disconnected).

When your startup & config code is done running in your Arduino sketch, do digitalWrite(yourPin, LOW) to enable the 74hc595's output pins, and away you go.

Good luck!



You can do that? That is beautiful.
https://sites.google.com/site/rgbledcubes

magagna

Quote
You can do that? That is beautiful.


Yep, I've done this before with a LED matrix -- shut off OE, update the shift registers and switch to the next row, then turn OE back on. This gets rid of any ghosting between the rows.
http://en.wiktionary.org/wiki/magagna <-- My last name.  Pretty apt.

dhenry

Quote
shut off OE, update the shift registers and switch to the next row, then turn OE back on.


You can get flickering with this approach, if a lot of data is transmitted.

A better approach is to use the latch.

Go Up