Skip to main content
added 11 characters in body
Source Link

Short answer

You probably forgotA wild guess: did you remember to add a 0.1uf capacitor between Vcc and GND, as the 74HC595 datasheet suggests.? This makes a huge difference.

Long answer

I just tried something that has a lot in common with what you were doing in your experiment. Here's my configuration

  1. I clock my 74HC595 from a 555 timer operating at 1.5 Hz with 50% duty cycle. I.e. nice even square pulses of fairly low frequency.

  2. The clock is fed into RCLK and SRCLK shorted together. According to the TI datasheet this a valid mode of operation for 74HC595. It says that in this configuration "the shift register is one clock pulse ahead of the storage register". Fine with me.

  3. The SER input is normally pulled down, but can be pulled up by a button. The longer I keep the button depressed, the more 1s is fed into the register as the clock ticks.

  4. No input is left floating: everything is either tied to GND or to Vcc.

  5. The outputs are connected to 8 LEDs with 470 Ohm resistors in series.

  6. The whole assembly is powered by 5V from a regulated PSU.

In this configuration I observed a rather strange behavior.

When I attempted to feed in a single 1 bit (by holding the button down for a fairly short period of time) I got the following sequence of combinations from my diodes, per each clock cycle

*.......
.**.....
...**...
.....**.
.......*

There two strange things here. Firstly, somehow one bit has turned into two bits. (I monitored the clock and the input on an oscilloscope and I knew for sure that I only fed in one bit). Secondly, which is even more strange, each clock cycle the register gets shifted by 2 bits (!) instead on one.

In the next experiment I held the button down for a long time - to fill the entire register with 1s - and then released it. This is what I observed

*.......
***.....   <--- strange
****....
*****...
******..
*******.
********   <--- normal
.*******
..******
...*****
....****
.....***
.......*   <--- strange
........

You can already see the underlying logic behind this behavior: when the number of 1s in the register is low, the register behaves "crazily" and shifts by 2 bits each clock cycle. But once the number of stored 1s gets higher, it suddenly switches to perfectly normal behavior.

I was able to immediately confirm this: if I tried to hold down the button to create a train of 4 sequential 1s, that train shifted through the register in perfectly correct fashion: one bit per clock cycle. No problems whatsoever. Only low-1-bit count patterns made 74HC595 to glitch.

And then I took another look at the datasheet and noticed that I forgot this

enter image description here

The moment I added that capacitor all problems went away.

Short answer

You probably forgot to add a 0.1uf capacitor between Vcc and GND, as the 74HC595 datasheet suggests. This makes a huge difference.

Long answer

I just tried something that has a lot in common with what you were doing in your experiment. Here's my configuration

  1. I clock my 74HC595 from a 555 timer operating at 1.5 Hz with 50% duty cycle. I.e. nice even square pulses of fairly low frequency.

  2. The clock is fed into RCLK and SRCLK shorted together. According to the TI datasheet this a valid mode of operation for 74HC595. It says that in this configuration "the shift register is one clock pulse ahead of the storage register". Fine with me.

  3. The SER input is normally pulled down, but can be pulled up by a button. The longer I keep the button depressed, the more 1s is fed into the register as the clock ticks.

  4. No input is left floating: everything is either tied to GND or to Vcc.

  5. The outputs are connected to 8 LEDs with 470 Ohm resistors in series.

  6. The whole assembly is powered by 5V from a regulated PSU.

In this configuration I observed a rather strange behavior.

When I attempted to feed in a single 1 bit (by holding the button down for a fairly short period of time) I got the following sequence of combinations from my diodes, per each clock cycle

*.......
.**.....
...**...
.....**.
.......*

There two strange things here. Firstly, somehow one bit has turned into two bits. (I monitored the clock and the input on an oscilloscope and I knew for sure that I only fed in one bit). Secondly, which is even more strange, each clock cycle the register gets shifted by 2 bits (!) instead on one.

In the next experiment I held the button down for a long time - to fill the entire register with 1s - and then released it. This is what I observed

*.......
***.....
****....
*****...
******..
*******.
********
.*******
..******
...*****
....****
.....***
.......*
........

You can already see the underlying logic behind this behavior: when the number of 1s in the register is low, the register behaves "crazily" and shifts by 2 bits each clock cycle. But once the number of stored 1s gets higher, it suddenly switches to perfectly normal behavior.

I was able to immediately confirm this: if I tried to hold down the button to create a train of 4 sequential 1s, that train shifted through the register in perfectly correct fashion: one bit per clock cycle. No problems whatsoever. Only low-1-bit count patterns made 74HC595 to glitch.

And then I took another look at the datasheet and noticed that I forgot this

enter image description here

The moment I added that capacitor all problems went away.

Short answer

A wild guess: did you remember to add a 0.1uf capacitor between Vcc and GND, as the 74HC595 datasheet suggests? This makes a huge difference.

Long answer

I just tried something that has a lot in common with what you were doing in your experiment. Here's my configuration

  1. I clock my 74HC595 from a 555 timer operating at 1.5 Hz with 50% duty cycle. I.e. nice even square pulses of fairly low frequency.

  2. The clock is fed into RCLK and SRCLK shorted together. According to the TI datasheet this a valid mode of operation for 74HC595. It says that in this configuration "the shift register is one clock pulse ahead of the storage register". Fine with me.

  3. The SER input is normally pulled down, but can be pulled up by a button. The longer I keep the button depressed, the more 1s is fed into the register as the clock ticks.

  4. No input is left floating: everything is either tied to GND or to Vcc.

  5. The outputs are connected to 8 LEDs with 470 Ohm resistors in series.

  6. The whole assembly is powered by 5V from a regulated PSU.

In this configuration I observed a rather strange behavior.

When I attempted to feed in a single 1 bit (by holding the button down for a fairly short period of time) I got the following sequence of combinations from my diodes, per each clock cycle

*.......
.**.....
...**...
.....**.
.......*

There two strange things here. Firstly, somehow one bit has turned into two bits. (I monitored the clock and the input on an oscilloscope and I knew for sure that I only fed in one bit). Secondly, which is even more strange, each clock cycle the register gets shifted by 2 bits (!) instead on one.

In the next experiment I held the button down for a long time - to fill the entire register with 1s - and then released it. This is what I observed

*.......
***.....   <--- strange
****....
*****...
******..
*******.
********   <--- normal
.*******
..******
...*****
....****
.....***
.......*   <--- strange
........

You can already see the underlying logic behind this behavior: when the number of 1s in the register is low, the register behaves "crazily" and shifts by 2 bits each clock cycle. But once the number of stored 1s gets higher, it suddenly switches to perfectly normal behavior.

I was able to immediately confirm this: if I tried to hold down the button to create a train of 4 sequential 1s, that train shifted through the register in perfectly correct fashion: one bit per clock cycle. No problems whatsoever. Only low-1-bit count patterns made 74HC595 to glitch.

And then I took another look at the datasheet and noticed that I forgot this

enter image description here

The moment I added that capacitor all problems went away.

Source Link

Short answer

You probably forgot to add a 0.1uf capacitor between Vcc and GND, as the 74HC595 datasheet suggests. This makes a huge difference.

Long answer

I just tried something that has a lot in common with what you were doing in your experiment. Here's my configuration

  1. I clock my 74HC595 from a 555 timer operating at 1.5 Hz with 50% duty cycle. I.e. nice even square pulses of fairly low frequency.

  2. The clock is fed into RCLK and SRCLK shorted together. According to the TI datasheet this a valid mode of operation for 74HC595. It says that in this configuration "the shift register is one clock pulse ahead of the storage register". Fine with me.

  3. The SER input is normally pulled down, but can be pulled up by a button. The longer I keep the button depressed, the more 1s is fed into the register as the clock ticks.

  4. No input is left floating: everything is either tied to GND or to Vcc.

  5. The outputs are connected to 8 LEDs with 470 Ohm resistors in series.

  6. The whole assembly is powered by 5V from a regulated PSU.

In this configuration I observed a rather strange behavior.

When I attempted to feed in a single 1 bit (by holding the button down for a fairly short period of time) I got the following sequence of combinations from my diodes, per each clock cycle

*.......
.**.....
...**...
.....**.
.......*

There two strange things here. Firstly, somehow one bit has turned into two bits. (I monitored the clock and the input on an oscilloscope and I knew for sure that I only fed in one bit). Secondly, which is even more strange, each clock cycle the register gets shifted by 2 bits (!) instead on one.

In the next experiment I held the button down for a long time - to fill the entire register with 1s - and then released it. This is what I observed

*.......
***.....
****....
*****...
******..
*******.
********
.*******
..******
...*****
....****
.....***
.......*
........

You can already see the underlying logic behind this behavior: when the number of 1s in the register is low, the register behaves "crazily" and shifts by 2 bits each clock cycle. But once the number of stored 1s gets higher, it suddenly switches to perfectly normal behavior.

I was able to immediately confirm this: if I tried to hold down the button to create a train of 4 sequential 1s, that train shifted through the register in perfectly correct fashion: one bit per clock cycle. No problems whatsoever. Only low-1-bit count patterns made 74HC595 to glitch.

And then I took another look at the datasheet and noticed that I forgot this

enter image description here

The moment I added that capacitor all problems went away.