74HC595 causes LED'S TO flash when arduino starts up

Hi all,

Just a niggle with my project - when I apply power to my arduino all the leds that I'm driving (via mosfets) from a few 74HC595'S blink for a fraction of a second - is there a hardware mod that I can do to eradicate this?

thanks!

There was a thread similar to this recently. Iirc, the secret was to do a digitalWrite LOW before the pinMode OUTPUT so that when it's set to output it's already low.

I think..... YMMV

edit... or HIGH I suppose, depends on your logic for off and on / high and low... But I can't find the thread.

Hi Jimbo, I will give that a go then thanks! -all 3 shift register pins?

Thought it would be a hardware thing but if its only software that would be great

I can't find the thread unfort, I may be talking total crap, but yeah give it a whirl

This is why it has a "~MR" - Master Reset pin 10 as on power-up, the output state is undefined. You can provide a 47k pull-up and a 0.1µF to ground, or connect it to Reset on the Arduino.

It is a little more complex than that. You want a 47k pull-down on pin 12 to prevent random noise strobing it until the Arduino starts up.

thanks Paul I will give it go when i get some time!

Which is pin 10 on the shift regsisters? I'm using them in non-spi mode as I'm using them with a Ethernet shield.

thanks Paul I will give it go when i get some time!

Which is pin 10 on the shift regsisters? I'm using them in non-spi mode as I'm using them with a Ethernet shield.

Another way is a pullup on the OE/ pin. That keeps the outputs off until your sketch starts up to pull it low with a PWM output or similar.

dtokez:
Which is pin 10 on the shift regsisters? I'm using them in non-spi mode as I'm using them with a Ethernet shield.

Is an HC595 SPI?

SPI can be used with HC595, makes for nice fast transfers:
SCK (13) to SRCLK
SS (10) to RCLK
MOSI (11) to SerIN
usually +5 to SRCLR (MSCLR?)
typically PWM to OE/ for brightness control with LEDs, or Gnd to OE/.

digitalWrite (ssPin, LOW);
SPI.transfer(data_to_send);
// or
SPI.transfer(dataArray[x]); // data from an array, good for looping thru data
// or
SPI.transfer(fontArray[dataArray[x]]); // double look up for 7-segment display
digitalWrite (ssPin, HIGH);

HC595 not the best part for LEDs, limit of 70mA for the part, so 8-9 mA per LED.
cd74AC164 much better part, especially in matrix use, with 20-24mA/pin drive capability.
or TPIC6B595 for sinking current, 150mA/pin sink capability.

CrossRoads:
SPI can be used with HC595, makes for nice fast transfers:

Interesting, thanks.