Parallel data input with 74LS165 driven by microcontroller I/O port

The function of the I/O interface is responsible for implementing the CPU to connect the I/O circuit and the peripheral device through the system bus. According to the complexity of the circuit and the device, the hardware of the I/O interface is mainly divided into two categories:

(1) I/O interface chip

These chips are mostly integrated circuits, which input different commands and parameters through the CPU, and control related I/O circuits and simple peripherals for corresponding operations. Common interface chips such as timer/counter, interrupt controller, DMA controller , parallel interface, etc.

(2) I/O interface control card

There are several integrated circuits that are organized into a single component, either directly on the motherboard with the CPU or a plug-in plugged into the system bus slot.

According to the connection object of the interface, they can be divided into serial interface, parallel interface, keyboard interface and disk interface.

The 74LS165 is driven by the timing of the I/O analog shift register to implement parallel data input. As shown in the figure below, P1.5 is used for serial data input, P1.6 is used for shift clock output, and P1.7 is used to control the operating state of 74LS165.

Parallel data input with 74LS165 driven by microcontroller I/O port

The MCU I/O port driver 74LS165 mainly includes a function declaration pin definition part, a data input function, and a data output function.

(1) Function declaration pin definition.

The function declaration pin definition part mainly completes the declaration of the library function involved in the program and the definition of the related pins. It is generally placed at the beginning of the program. The code is as follows:

Parallel data input with 74LS165 driven by microcontroller I/O port

(2) The data input function in_simuseri().

The data input function in_simuseri() implements serial input from low to high 8-bit data. The program code is as follows:

Parallel data input with 74LS165 driven by microcontroller I/O port

Parallel data input with 74LS165 driven by microcontroller I/O port

(3) Data output function PAs().

The data output function PAs() implements parallel output of data. The program code is as follows:

Parallel data input with 74LS165 driven by microcontroller I/O port

Annealing Machine

Annealing Machine,Pv Copper Strip Annealing Machine,Pv Copper Strip Annealing Equipment,Annealing Heat Treatment Machine

Jiangsu Lanhui Intelligent Equipment Technology Co., Ltd , https://www.lanhuisolar.com