7-Segment display with 74HC595 shift register – CCS C

There are many topics in this blog talking about the 7-segment display and how to interface it with different types of PIC microcontrollers. One of these topics shows how to interface PIC16F877A with a multiplexed 4-digit 7-segment display with the shift register 74HC164N.

7-Segment display with shift register hardware circuit

In this topic we are going to see how to make a digital up/down counter using multiplexed 7-segment display with 74HC595 shift register and PIC16F877A microcontroller.
From the 74HC595 datasheet this shift register is a high speed, 8-stage serial shift register with a storage register and 3-state outputs. The registers have separate clocks.
Data is shifted on the positive-going transitions of the shift register clock input (SHCP). The data in each register is transferred to the storage register on a positive-going transition of the storage register clock input (STCP). If both clocks are connected together, the shift register will always be one clock pulse ahead of the storage register.

The following table shows the 74HC595 shift register pin-outs:
74HC595 shift register pin configuration

7-Segment display with 74HC595 shift register:
The following circuit schematic shows a multiplexed 4 digits connected to the 74HC595 shift register. The type of the 7-segment display used in this example is common anode.

In the circuit there are two push buttons, these buttons are used to increment and decrement the displayed number.
7-Segment display 74HC595 shift register circuit

7-Segment display with 74HC595 shift register interfacing with PIC16F877A CCS C code:
Here is the example code I think it is a small and clear code.

7-Segment display with 74HC595 shift register interfacing with PIC16F877A video:
The following video from a real hardware circuit for the digital counter.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.