The connection and data exchange between the CPU and external devices and memory need to be realized through interface devices. The former is called I/O interface, and the latter is called memory interface. Memory usually works under the synchronous control of the CPU, and the interface circuit is relatively simple; while there are many varieties of I/O devices, and their corresponding interface circuits are also different. Therefore, it is customary to refer to I/O interface when talking about interface.
1. Concept of I/0 interface
1. Classification of interfaces
The function of the I/O interface is to connect the I/O circuit and peripheral devices through the system bus of the CPU. 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
Most of these chips are integrated circuits. They input different commands and parameters through the CPU and control related I/O circuits and simple peripherals to perform corresponding operations. Common interface chips include timers/counters, interrupt controllers, DMA controllers, parallel interfaces, etc.
2) I/O interface control card
Several integrated circuits are logically combined into a component, either directly on the motherboard with the CPU, or as a plug-in inserted 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, etc.
2. Interface Function
Since there are many kinds of computer peripherals, almost all of which use electromechanical transmission devices, the CPU has the following problems when exchanging data with I/O devices:
Speed mismatch: The working speed of I/O devices is much slower than that of the CPU, and due to different types, the speed difference between them is also very large. For example, the transmission speed of a hard disk is much faster than that of a printer.
Timing mismatch: Each I/O device has its own timing control circuit and transmits data at its own speed, which cannot be unified with the timing of the CPU.
Information format mismatch: Different I/O devices store and process information in different formats, for example
There are two types: serial and parallel; it can also be divided into binary format, ACSII encoding and BCD encoding, etc.
Information type mismatch: Different I/O devices use different signal types, some are digital signals, and some are analog signals, so the processing methods used are also different.
Based on the above reasons, data exchange between the CPU and peripherals must be completed through interfaces. Usually, interfaces have the following functions:
1) Set up data storage and buffering logic to adapt to the speed difference between the CPU and peripherals. The interface is usually composed of some registers or RAM chips. If the chip is large enough, it can also realize batch data transmission;
2) Ability to convert information formats, such as serial and parallel conversion;
3) Ability to coordinate the differences in information type and level between the CPU and peripherals, such as level-shifting drivers, digital/analog or analog/digital converters, etc.
4) Coordinate timing differences;
5) Address decoding and device selection functions;
6) Set up the interrupt and DMA control logic to ensure that interrupt and DMA request signals are generated when interrupt and DMA are allowed, and complete interrupt processing and DMA transfer after receiving interrupt and DMA response.
3. Interface control method
There are several ways for the CPU to control peripherals through interfaces:
1) Program query method
In this mode, the CPU inquires about the current status of the specified peripheral through I/O instructions. If the peripheral is ready, data is input or output. Otherwise, the CPU waits and queries in a loop.
The advantage of this method is that it has a simple structure and only requires a small amount of hardware circuits. The disadvantage is that since the CPU speed is much higher than the peripherals, it is usually in a waiting state and the working efficiency is very low.
2) Interrupt handling method
In this way, the CPU no longer waits passively, but can execute other programs. Once the peripheral is ready for data exchange, it can make a service request to the CPU. If the CPU responds to the request, it will temporarily stop the execution of the current program and switch to execute the service program corresponding to the request. After completion, it will continue to execute the original interrupted program.
The advantages of interrupt handling are obvious. It not only saves the CPU the time spent on querying the status of peripherals and waiting for them to be ready, improves the CPU's working efficiency, but also meets the real-time requirements of peripherals. However, an interrupt request number and a corresponding interrupt service program need to be assigned to each I/O device. In addition, an interrupt controller (I/O interface chip) is required to manage the interrupt requests raised by the I/O devices, such as setting interrupt masking, interrupt request priority, etc.
In addition, the disadvantage of the interrupt processing method is that an interrupt must be generated every time a character is transmitted, the interrupt controller must be started, and the scene must be preserved and restored in order to continue the execution of the original program. This requires a lot of work, so if a large amount of data exchange is required, the system performance will be very low.
3) DMA (direct memory access) transfer method
One of the most obvious features of DMA is that it uses a dedicated controller instead of software to control the data exchange between memory and peripherals, without the need for CPU intervention, greatly improving the CPU's work efficiency.
Before performing DMA data transmission, the DMA controller will apply to the CPU for bus control. If the CPU allows, it will hand over the control. Therefore, during data exchange, the bus control is held by the DMA controller. After the transmission is completed, the DMA controller returns the bus control to the CPU.
2. Common interfaces
1. Parallel interface
At present, the parallel interface in the computer is mainly used as a printer port. The interface no longer uses a 36-pin connector but a 25-pin D-shaped connector. The so-called "parallel" means that 8 bits of data are transmitted simultaneously through parallel lines, which greatly improves the data transmission speed, but the length of the parallel transmission line is limited, because as the length increases, interference will increase, which is prone to errors.
There are five common parallel ports: 4-bit, 8-bit, half 8-bit, EPP and ECP. Most PCs are equipped with 4-bit or 8-bit parallel ports. Many portable computers using INTEL386 chipsets are equipped with EPP ports. Computers that support all IEEE1284 parallel port specifications are equipped with ECP parallel ports.
Standard parallel port 4-bit, 8-bit, half 8-bit:
A 4-bit port can only input 4 bits of data at a time, but can output 8 bits of data; an 8-bit port can input and output 8 bits of data at a time; half-8 bits is also possible.
EPP port (Enhanced Parallel Port): Developed by INTEL and other companies, it allows 8-bit bidirectional data transmission and can connect various non-printer devices such as scanners, LAN adapters, disk drives, and CDROM drives.
ECP port (Extended Parallel Port): Developed by Microsoft and HP, it can support command cycles, data cycles and multiple logical device addressing, and can use DMA (direct memory access) in a multi-tasking environment.
Currently, almost all 586 motherboards are equipped with a parallel port socket, marked as Parallel 1 or LPT 1, which is a 26-pin double-row pin socket.
2. Serial interface
Another standard computer interface is the serial port. Today's PCs generally have at least two serial ports, COM1 and COM2. The difference between a serial port and a parallel port is that its data and control information are transmitted serially, one bit at a time. In this way, although the speed is slower, the transmission distance is longer than that of a parallel port, so a serial port should be used for long-distance communication. Usually COM1 uses a 9-pin D-shaped connector, while some COM2 uses an old-fashioned DB25-pin connector.
3. Disk interface
1) IDE interface
The IDE interface is also called the ATA port. It can only connect two hard disk drives with a capacity of no more than 528M. The cost of the interface is very low, so it was very popular in the 38*86 era. However, most IDE interfaces do not support DMA data transfer and can only use standard PCI/O port instructions to transfer all commands, status, and data. Almost all 586 motherboards are integrated with two 40-pin double-row IDE interface sockets, marked as IDE1 and IDE2.
2) EIDE interface
The EIDE interface is a significant improvement over the IDE interface and is currently the most popular interface.
First of all, the number of peripherals it supports is no longer 2 but 4. In addition to hard disks, the supported devices also include CD-ROM drives, disk backup devices, etc.
Secondly, the EIDE standard removed the 528MB limit and replaced it with an 8GP limit.
Third, EIDE has a higher data transfer rate and supports PIO Mode 3 and Mode 4 standards.
4.SCSI interface
SCSI (Small Computer System Interface) is a small computer system interface. Hard disks with SCSI interfaces are widely used in computers that do graphics processing and network services. In addition to hard disks, SCSI interfaces can also connect CD-ROM drives, scanners, and printers. It has the following characteristics:
*Can connect 7 peripherals at the same time;
* Bus configuration is parallel 8-bit, 16-bit or 32-bit;
* The maximum hard disk space allowed is 8.4GB (some have reached 9.09GB);
* Higher data transfer rate: IDE is 2MB/s, SCSI can usually reach 5MB/s, FASTSCSI (SCSI-2) can reach 10MB/s, and the latest SCSI-3 can even reach 40MB/s, while EIDE can only reach a maximum of 16.6MB/s;
* The cost is much higher than that of IDE and EIDE interfaces. In addition, SCSI interface hard drives must be used in conjunction with SCSI interface cards, which are also much more expensive than IDE and EIDE interfaces.
*SCSI interfaces are intelligent and can communicate with each other without increasing the burden on the CPU. When transferring data between IDE and EIDE devices, the CPU must intervene, while SCSI devices take the initiative in the data transfer process and can perform specific operations within the SCSI bus until completion and then notify the CPU.
5.USB interface
The latest USB serial interface standard is jointly launched by Microsoft, INTEL, Compaq, IBM and other major companies. It provides hot plug-and-play connection outside the chassis. Users no longer need to open the chassis and turn off the power when connecting peripherals. Instead, they use a "cascade" method. Each USB device uses a USB plug to connect to a USB socket of a peripheral, and it itself provides a USB socket for the next USB device to use. Through this connection, a USB controller can connect up to 127 peripherals, and the distance between each peripheral can reach 5 meters. The USB unified 4-pin round plug will replace the numerous serial/parallel ports (mouse, MODEM) keyboard and other plugs behind the chassis. USB can intelligently identify the insertion or removal of peripherals on the USB chain. In addition to being able to connect keyboards, mice, etc., USB can also connect low-speed peripherals such as ISDN, telephone systems, digital audio, printers and scanners.
3. I/O expansion slot
The I/O expansion slot is the path for I/O signal transmission and is an extension of the system bus. Any standard option can be inserted, such as a display card, decompression card, MODEM card, and sound card. Through the I/O expansion slot, the CPU can address and access all I/O interface chips and control cards connected to the channel for reading and writing.
Depending on the type of bus, the expansion slots on the motherboard can be divided into ISA, EISA, MAC, VESA and PCI.
1) ISA slot
Black, divided into 8-bit and 16-bit. The 16-bit expansion slot can be inserted with 8-bit and 16-bit control cards, but the 8-bit expansion slot can only be inserted with 8-bit cards.
2) EISA slot
Brown, the appearance and length are the same as the 16-bit ISA card, but it is deeper and can be inserted with ISA and EISA control cards.
3) VESA slot
Brown, located below the 16-bit ISA expansion slot and used in conjunction with the ISA slot.
4) PCI slot
White, the same length as the VESA slot, parallel to the ISA slot, does not need to be used with the ISA slot, and can only be inserted into the PCI control card. Due to the limited space on the motherboard, the PCI slot takes up the position of the ISA slot
Previous article:Design of electronic blood pressure meter based on MSP430F149 microcontroller
Next article:Design of tension control system for coiler based on single chip microcomputer
Recommended ReadingLatest update time:2024-11-16 22:56
- Popular Resources
- Popular amplifiers
Professor at Beihang University, dedicated to promoting microcontrollers and embedded systems for over 20 years.
- Innolux's intelligent steer-by-wire solution makes cars smarter and safer
- 8051 MCU - Parity Check
- How to efficiently balance the sensitivity of tactile sensing interfaces
- What should I do if the servo motor shakes? What causes the servo motor to shake quickly?
- 【Brushless Motor】Analysis of three-phase BLDC motor and sharing of two popular development boards
- Midea Industrial Technology's subsidiaries Clou Electronics and Hekang New Energy jointly appeared at the Munich Battery Energy Storage Exhibition and Solar Energy Exhibition
- Guoxin Sichen | Application of ferroelectric memory PB85RS2MC in power battery management, with a capacity of 2M
- Analysis of common faults of frequency converter
- In a head-on competition with Qualcomm, what kind of cockpit products has Intel come up with?
- Dalian Rongke's all-vanadium liquid flow battery energy storage equipment industrialization project has entered the sprint stage before production
- Allegro MicroSystems Introduces Advanced Magnetic and Inductive Position Sensing Solutions at Electronica 2024
- Car key in the left hand, liveness detection radar in the right hand, UWB is imperative for cars!
- After a decade of rapid development, domestic CIS has entered the market
- Aegis Dagger Battery + Thor EM-i Super Hybrid, Geely New Energy has thrown out two "king bombs"
- A brief discussion on functional safety - fault, error, and failure
- In the smart car 2.0 cycle, these core industry chains are facing major opportunities!
- The United States and Japan are developing new batteries. CATL faces challenges? How should China's new energy battery industry respond?
- Murata launches high-precision 6-axis inertial sensor for automobiles
- Ford patents pre-charge alarm to help save costs and respond to emergencies
- New real-time microcontroller system from Texas Instruments enables smarter processing in automotive and industrial applications
- Technical article: The magic of energy monitoring in DC systems
- Please give me some advice on the previous interview questions.
- cc2640 details display
- Powering a Boost Topology Battery Charger with a Solar Panel
- [RISC-V MCU CH32V103 Review] USB flash drive read and write test
- NI Special Month, enjoy up to 40% off on software and more!
- Help: About the ESP32 Anxinke integrated environment project import compilation error
- Various PCB onboard antennas and PCB design points
- 【Silicon Labs Development Kit Review 06】_Transplanting freertos+Vcom+LED
- Agilent fully supports TD-SCDMA testing and increases R&D investment in China