Pages: [1]   Go Down
Author Topic: quiet start-up for shift register?  (Read 783 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Logged

Global Moderator
Boston area, metrowest
Offline Offline
Brattain Member
*****
Karma: 518
Posts: 26371
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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.

Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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!
Logged

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

Offline Offline
Newbie
*
Karma: 0
Posts: 5
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Eugene, Oregon
Offline Offline
Sr. Member
****
Karma: 9
Posts: 388
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged


Southern California
Offline Offline
God Member
*****
Karma: 5
Posts: 539
I like blinky lights
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

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

Offline Offline
Edison Member
*
Karma: 116
Posts: 2205
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: