All You Need to Know About the 74HC165 Eight-Bit Shift Register

16 April 2024


Ⅰ. Introduction to 74HC165

Ⅱ. Functions of 74HC165

Ⅲ. Logic diagram of 74HC165

Ⅳ. Working principle of 74HC165

Ⅴ. Recommended operating conditions of 74HC165

Ⅵ. Precautions for using 74HC165

Ⅶ. What is the role of 74HC165?

Ⅷ. How to switch between serial input and parallel reading of 74HC165?



Ⅰ. Introduction to 74HC165


8585ac709efc608409ee9e33af5b3093.png


74HC165 is a high-speed CMOS eight-bit parallel-in and serial-out shift register with an operating voltage range of 2.0V to 6.0V and a drive current of ±5.2mA. It is equipped with multiple input pins and a parallel output pin, which can convert serial input data into parallel output. This chip has an operating temperature range of -40°C to 85°C and is available in a variety of packages such as SO16, SSOP16, DIP16 and TSSOP16. In addition, the 74HC165 uses advanced CMOS technology, so it has the characteristics of low power consumption, high-speed operation and high reliability. Due to these excellent performances, it is widely used in many fields such as keyboard scanning, data collection, status detection, etc.



Ⅱ. Functions of 74HC165


The 74HC165 has the following features:

1. Cascade operation: Multiple 74HC165 chips can be cascaded together to expand the number of input signals. Cascade operation is achieved through the cascade pin (SERA/B) and the cascade output pin (QH). Specifically, the cascade pin can connect the output of one 74HC165 to the input of another 74HC165, thereby enabling serial transmission of data.

2. Parallel loading: In addition to shift operations, 74HC165 also has a parallel loading function for reading and storing input signals. This operation is controlled through the clock enable pin (CLKINH) and the parallel load pin (PL). When the clock enable pin is high and the parallel load pin is also high, the parallel load operation can be triggered. This mode of operation makes the 74HC165 more flexible and efficient when reading input signals.

3. Serial output: 74HC165 has a serial output pin (QH), which can convert the input signal into a serial output signal. The output signals are read in the same order as the input signals.

4. Parallel input: 74HC165 has 8 parallel input pins (A-H), which can read 8 input signals at the same time. These input signals can be digital signals or analog signals.

5. Shift operation: 74HC165 can read and store input signals through shift operations. This operation is controlled by a clock signal (SH/LD) and a clock enable signal (CLKINH). When the clock enable signal is at a high level, the shift operation is performed; when the clock enable signal is at a low level, the shift operation is disabled.



Ⅲ. Logic diagram of 74HC165


62c3ae94923e08d241339e11cf4779cf.png


"H" indicates a high level, "L" indicates a low level, "h" indicates a high level when the clock is a rising edge, "I " indicates a low level when the clock is a rising edge, and "q" indicates the output state when the clock is a rising edge. "↑" indicates a rising edge.



Ⅳ. Working principle of 74HC165


The working principle of 74HC165 is based on the design of shift register. It uses four input pins (SER, SRCLK, RCLK, OE) to implement serial input and parallel output of data. Driven by the clock signal, data enters the register bit by bit through the serial input pin SER. Whenever a rising edge occurs on the clock signal, the data is shifted one bit to the left, and the highest bit shifted out is entered into the cascade or passed to the next shift register. This mechanism allows the 74HC165 to efficiently process serial data and convert it into parallel output, thereby facilitating subsequent circuit processing.



Ⅴ. Recommended operating conditions of 74HC165


Voltages are referenced to GND (ground=0V)

ea4c232b9928dfb80423ff9a245c97bd.png


Ⅵ. Precautions for using 74HC165


When using 74HC165, we should pay attention to the following points:

1. Power supply and grounding: We need to ensure that we provide a stable and suitable power supply to the 74HC165 and ensure that it is well grounded. Unstable power supply or poor grounding may cause the chip to work abnormally.

2. Input signal: We need to ensure that the signal input to the 74HC165 is within the specified range to avoid abnormal inputs such as overvoltage and overcurrent. Abnormal input may cause chip damage or unstable operation.

3. Switching between serial input and parallel reading: When switching the serial input and parallel reading modes of 74HC165, we need to pay attention to the level state of the PL (parallel reading) input terminal. We need to make sure we set the PL input to the correct level before switching and follow the correct sequence of operations.

4. Cascade use: If multiple 74HC165s need to be cascaded, we must ensure that the cascade connection is accurate and follow the correct clock and enable control methods. In addition, it is worth noting that the time interval between the rising edge of the cp pin and the data output may vary among 74HC165 chips produced by different manufacturers. If the delay is insufficient, incorrect data may be read.

5. Temperature and packaging: 74HC165 has specific temperature range requirements and must be ensured to be used within the recommended operating temperature range. In addition, when selecting 74HC165, we should choose the appropriate package type based on specific application requirements, such as dual in-line package (DIP) or plastic leaded chip carrier package (PLCC).

6. Electrostatic protection: 74HC165 is an electrostatic sensitive device, so we must take appropriate electrostatic protection measures during handling, storage and installation to prevent electrostatic damage.



Ⅶ. What is the role of 74HC165?


As a serial input or parallel output shift register, 74HC165 mainly has the following functions:

1. Status detection: 74HC165 can be used to detect the status of multiple switches or sensors. By connecting the output of a switch or sensor to the input pin of the 74HC165, their state changes can be monitored in real time. This is very useful in applications such as automation control, security alarms and instrument monitoring.

2. Keyboard scanning: 74HC165 can be used for scanning and detection of keyboard input. By inputting the keyboard row and column signals into the 74HC165 chip bit by bit, we can detect whether a key is pressed according to a fixed scanning sequence and read the corresponding key code. This function is widely used in computer keyboards, control panels and other applications, effectively improving the response speed and accuracy of keyboard input.

3. Data input expansion: 74HC165 can expand the number of input ports of digital circuits. Through the serial input pin, we can input multiple signals from external devices or sensors into the 74HC165 chip for processing. This is useful for systems that need to receive a large number of input signals, such as keyboards, control panels, and switches.

4. Data collection and storage: 74HC165 can store serial input data according to a certain timing. When all data input operations are completed, through the parallel output pin, we can read the stored data simultaneously. This feature makes the data acquisition and storage process more convenient and efficient, so the 74HC165 has been widely used in many applications such as data loggers, logic analyzers, and sensor interfaces.



Ⅷ. How to switch between serial input and parallel reading of 74HC165?


The serial input and parallel read modes of the 74HC165 can be switched by changing the level state of the PL (parallel load) input. When the PL input is low, the 74HC165 is in parallel read mode. At this time, the parallel data input port from D0 to D7 will read data into the register asynchronously. In this mode, data can be loaded into registers in parallel, enabling fast data reads.


When the PL input is high, the 74HC165 switches to serial input mode. At this point, data will be serialized bit by bit from the DS (serial data) input into the register, shifting one bit to the right on the rising edge of each clock pulse. In this mode, data enters the register bit by bit in a serial manner, and a shift operation is performed inside the register, realizing serial input and storage of data.


Therefore, by controlling the level state of the PL input terminal, it can easily switch between serial input and parallel read modes to adapt to different application needs. It should be noted that before the rising edge of PL, both the CP (clock pulse) and CE (clock enable) inputs should be set to high level to prevent data from shifting in the active state of PL. In addition, the clock input of the 74HC165 also has a gated structure, one of which can be used as an active-low clock enable (CE) input. This structure provides greater flexibility, allowing users to choose clock and enable control methods based on specific application requirements.




Frequently Asked Questions


1. What is 74HC165 used for?


The 74HC165 is a shift register with eight parallel inputs: it enables you to simultaneously sample eight input pins, and then read the result one bit at a time. In other words, it is an easy way to expand the number of input pins for your microcontroller. The shift register has two states: sampling and shifting.


2. What is the difference between 74HC165 and 74HC595?


The 74HC165 can be used to connect upto 8 inputs (e.g. switches) to just a few GPIO's. The 74HC595 can be used to connect upto 8 outputs (e.g. LEDs) to just a few GPIO's. For a newcomer, the main distinction in shift registers is probably parallel in/serial out (PISO) and serial in/parallel out (SIPO).


3. What is the serial input of 74HC165?


74HCT165 are 8-bit serial or parallel-in/serial-out shift registers. The device features a serial data input (DS), eight parallel data inputs (D0 to D7) and two complementary serial outputs (Q7 and Q7).


4. How does 74HC165 work?


The 74HC165 is an 8-bit Parallel In Serial Out(PISO) shift register. You can use PISO to read the status of 8 pins using only three pins on the Arduino UNO. The shift register 74HC165 is used to increase the number of input pins for Arduino.