Basics of 74HC595

74HC595 is a shift register which works on Serial IN Parallel OUT protocol.
It receives data serially from the microcontroller and then sends out this data through parallel pins.
We can increase our output pins by 8 using the single chip.
We can also connect more than 1 shift register in parallel.
So, let’s say I have connected three shift registers with our microcontroller then our output pins are increased by 8 x 3 = 24.
I hope I have cleared the idea, so now let’s have a look at its pinout.

74HC595 Pinout

As you can see from the figure it has below pinouts:
Pin 1 to Pin # 7 are Output Pins Q1 – Q7.
Pin 15 is also Output Pin Q0.
Pin 8 is Ground.
Pin 9 is Q7′ (OutPut Serial Data).
Pin 10 is Master Reset.
Pin 11 is SHCP which is short for Shift Register Clock Input.
Pin 12 is STCP which is short for Storage Register Clock Input.
Pin 13 is OE which is Output Enable.
Pin 14 is DS which is Serial Data input.
Pin 16 is Vcc where we have to supply the power +5V.

How 74HC595 Shift Register works?

The 595 has two registers (which can be thought of as “memory containers”), each with just 8 bits of data. The first one is called the Shift Register. The Shift Register lies deep within the IC circuits, quietly accepting input.

Whenever we apply a clock pulse to a 595, two things happen:

  • The bits in the Shift Register move one step to the left. For example, Bit 7 accepts the value that was previously in bit 6, bit 6 gets the value of bit 5 etc.
  • Bit 0 in the Shift Register accepts the current value on DATA pin. At the rising edge of the pulse, if the data pin is high, then a 1 gets pushed into the shift register. Otherwise, it is a 0.

On enabling the Latch pin, the contents of Shift Register are copied into the second register, called the Storage/Latch Register. Each bit of the Storage Register is connected to one of the output pins QA–QH of the IC, so in general, when the value in the Storage Register changes, so do the outputs.

Protected Area

This content is password-protected. Please verify with a password to unlock the content.

Fare attenzione a impostare le variabili all’inizio dello sketch con i pin effettivamente collegati.

//Connesso al Pin DS del 74HC595
int dataPin = 8;

//Connesso al Pin ST_CP del 74HC595
int latchPin = 9;

//Connesso al Pin SH_CP del 74HC595
int clockPin = 10;