I have a serial to parallel chip ( 74HC595-N ) which work well when I run the arduino script made for it. ( the current wiring work perfectly when I send data through the data pin )

But then I started to play around with other pin, leaving the 74HC595 circuit simply not initialized: I don't use the PIN in the 2nd script ( I use other pins ).

And I realized that when I play around with my 2nd circuit, for no apparent reason, the lights from the first circuit change state.

I though : hum, must be that weird concept of "floating voltage" I heard about... Not sure how to address that, but fair enought.

So I decide to fix the problem the lazy way and unplug the 3 cable ( latch, clock and data), great the light stopped flashing... Oh wait now ALL the lights are permanently ON. Since I'm not sending anything through the data cable, I'd like the LED to be OFF by default. I've tried to put some resistence in a attempt to create a pull up and/or pull down resistance, but it changed nothing ( possibly because I don't know what I'm doing as I don't fully understand what's going on and the details of how that chip work)... I'm just impressed I didn't blew anything.

I know you'll say it's probably a useless question and bla bla bla, but I'm still learning and most of the "project" I'm doing right now are useless anyway, so I'd like to understand why all the light are on, and how to fix this problem. Kind of a side quest in my electronic adventure.

I drew a diagram from CircuitLab. ( Ps.: I know I kind of wired the 7segments display a weird way, I just figured out how to count the PIN order recently ... did I told you I was beginning ? ) enter image description here

  • \$\begingroup\$ Your text needs to decide on a single part number... \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 10 '13 at 21:08
  • \$\begingroup\$ @IgnacioVazquez-Abrams I'm having trouble with typing 595, I've fixed it. Thanks for pointing it out. \$\endgroup\$ – FMaz008 Jun 10 '13 at 21:11
  • \$\begingroup\$ If you are using a 74HC595, you are using a HCMOS part. by unplugging the three cables, you could have severely damaged your device because of (1) ESD, and also (2) both P- and N- MOSFETS could have been on. \$\endgroup\$ – fuzzyhair2 Jun 10 '13 at 21:15
  • \$\begingroup\$ @fuzzyhair2 Ok, well I didn't know. But I guess I'm lucky as the chip (both) are still working fine... even if I did that over and over today. \$\endgroup\$ – FMaz008 Jun 10 '13 at 21:21
  • \$\begingroup\$ Ok. yeah just be careful with CMOS stuff. Even though they have built-in ESD protection they could get damaged if you walk accross a carpet or somjething/. \$\endgroup\$ – fuzzyhair2 Jun 10 '13 at 21:22

The problem here seems to be that you're assuming that the outputs of the 74HC595 will all be low upon power-up.

This is not a valid assumption. The datasheet makes no guarantee about the state of the outputs upon power-up. They could be high, they could be low, they could vary from part to part, they even could be a mixture of high and low on different pins.

Basically, the only way to ensure that the 595's output pins are in a known state when you power it up is to have a circuit that triggers the MR input when the system is powered, and continues triggering the MR pin until the 5V power is stable.

As an aside, I actually was recently working on a project where I needed some additional outputs, and I specifically didn't use a 75HC595 for exactly this reason - you cannot guarantee it's power-on state.

  • \$\begingroup\$ Connor, what alternative did you use to the 595? \$\endgroup\$ – Bertus Kruger May 30 '14 at 20:04
  • \$\begingroup\$ @BertusKruger - A Microchip MCP23S08. It's a SPI-interfaced IO expander. Rather an odd duck of a chip, but it has internal power-on-reset electronics, and just needs a SPI interface. You have to set it up from your MCU though (this was fine in my application). \$\endgroup\$ – Connor Wolf May 30 '14 at 20:10
  • \$\begingroup\$ Nice little setup with I2C as well. Would the MCP23SO8 be able to be chained? \$\endgroup\$ – Bertus Kruger May 31 '14 at 21:00
  • \$\begingroup\$ @BertusKruger - Either version can have multiple devices on the same bus, with addressing. Either 4 devices (MCP23S08) or 8 devices (MCP2308). As usual, read the datasheet. \$\endgroup\$ – Connor Wolf May 31 '14 at 22:58

I'd like to understand why all the light are on, and how to fix this problem

Put pull-down resistors on unused or open circuit inputs like clk, data and latch. Without anything connected to them they will float around to strange values and clock randomly any random voltage on the inputs and light LEDs randomly or consistently if the data input decides to drift high for a while. CMOS doesn't work well with open-circuited inputs.

To quote yourself: -

must be that weird concept of "floating voltage" I heard about... Not sure how to address that

Hopefully you do now - use 10k ohms on each open-circuit line to ground

  • \$\begingroup\$ Ok, so I did add 3x 10Kohm resistance, 1 for each cable that makes a link between the pin 11,12,14 and the Ground. Now the light doesn't flash anymore, but when I load my 2nd scenario, the last value is kept displayed ( as if the display was frozen ). If I unplug the 5V and plug it back, all LED will be on. \$\endgroup\$ – FMaz008 Jun 10 '13 at 21:35
  • \$\begingroup\$ You need to add a power monitor IC then, to keep ~MR low until power is stable and the clock rises. \$\endgroup\$ – Ignacio Vazquez-Abrams Jun 10 '13 at 21:48
  • \$\begingroup\$ @FMaz008 even though you took the power away, CMOS will take power from any input that is set high (maybe Latch or clk or data) and keep the device alive. You remove power and keep inputs "live" and you may damage your CMOS. \$\endgroup\$ – Andy aka Jun 10 '13 at 21:58
  • \$\begingroup\$ @Andyaka When I said I removed the 5V, it was from everything. ( no more power anywhere on the breadboard or arduino ). Latch, clock and data are pulled down now. So since the segment is common anode, it's sending LOW to all input and the LED goes ON. \$\endgroup\$ – FMaz008 Jun 10 '13 at 22:02
  • \$\begingroup\$ Did you have any power decoupling caps on the circuit containing the 595 - removing power would keep these charged up and quite possibly to a level where they retained the memory in the D type latches in the shift register. \$\endgroup\$ – Andy aka Jun 11 '13 at 7:33

Not the answer you're looking for? Browse other questions tagged or ask your own question.