Design and application of interface conversion based on single chip microcomputer

Publisher:haoyingLatest update time:2012-04-18 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
This paper discusses the design of converting the interface between RS232C and GPIB (general-purpose interface bus) by controlling Intel8251A and MC68488 interface chips with AT89C51 single-chip microcomputer, and applies it to the program-controlled probe positioning equipment of printed circuit boards.
Keywords: single-chip microcomputer, GPIB, RS232C, interface converter 1 Introduction In the field of electronic measurement and instrumentation, GPIB and RS232C are widely used standard interface buses. GPIB is suitable for establishing automatic test systems (ATS), and RS232C is often used for the connection between data terminal equipment (DTE) and data communication equipment (DCE). At present, many dedicated large-scale integrated circuit chips have been developed to help designers realize GPIB and RS232C interfaces, and these chips are compatible with the internal bus of microprocessors. The standard interface bus solves the interface problem between devices or between functional components. An ATS can be formed by connecting several devices or functional components with the help of an appropriate interface bus. If a test device based on a standard interface system is used as a subsystem, and several subsystems are connected to form a large system or a test and control network, the actual problem that needs to be solved is the conversion between different standard interface buses. 2 Interface conversion hardware design GPIB (ie IEEE488) is a commonly used interface for programmable measuring instruments, and the IEEE488 and IEC625 standard texts have been officially promulgated. The first large-scale integrated circuit GPIB interface chip to be put on the market was Motorola's MC68488. RS232C is the most commonly used serial communication standard, used for the interface between DTE and DCE. The standard LSI chip commonly used for serial communication interfaces is Intel8251A. Using an integrated interface chip compatible with GPIB and RS232C standards as the input/output port on the internal bus of the microprocessor can form a GPIB-RS232C converter. The GPIB-RS232C conversion circuit board uses AT89C51 as the control center, MC68488 to connect to the GPIB system bus, and INTEL8251A as the interface between AT89C51 and RS232C, thereby realizing GPIB-RS232C interface conversion. AT89C51 is a low-power, high-performance CMOS 8-bit microcontroller with 4K bytes of flash programmable erasable read-only memory (PEROM). The device is manufactured using ATMEL's high-density, non-volatile memory manufacturing technology and is compatible with the industry-standard MCS-51 instruction set and output pins. AT89C51 has the following standard features: 4K bytes of flash memory, 128 bytes of RAM, 32 I/O lines, 2 16-bit timers/counters, 5 two-level interrupt source structures, 1 full-duplex serial port, on-chip oscillator and clock circuit. In addition, AT89C51 has static logic, can work under low to zero frequency conditions, and supports 2 software-selectable power saving modes. In idle mode, the CPU stops working, but the RAM, timer/counter, serial port and interrupt system are still working. In power-down mode, the contents of RAM are saved, the oscillator is frozen, and all other on-chip control unit functions are disabled until the next hardware reset. The main functions of the GPIB-RS232C interface conversion circuit board are: MC68488 has complete GPIB listening/talking capabilities, and Intel8251A has the ability to send and receive bit serial data. Therefore, under the management of the GPIB controller, data exchange between GPIB devices and RS232C devices can be correctly realized; as a GPIB device, the interface conversion circuit board has single or dual master-slave address recognition capabilities and responds to relevant GPIB commands sent by the GPIB controller. Figure 1 is a schematic diagram of the GPIB-RS232C interface conversion circuit.







3 Interface conversion software design
Because of the large-scale integrated circuit interface chip, the hardware implementation of the interface conversion circuit board is relatively easy. The key is to design a complete supervision and management program. The program flow chart is shown in Figure 2. The process design is based on GPIB transmitting data to RS232C. Therefore, after the monitoring system is initialized, it first identifies whether MC68488 is listening to the command? Once it is listening to the command, it receives GPIB data until a data block is input. After the data block is input, the Intel8251 data transmission part is started, and the data bytes input from MC68488 are continuously sent. RS232C receives data from identifying the Intel8251 receiving interrupt. If the Intel8251 status register D7 = 1, the supervision program will enter the branch of receiving data from RS232C. First, the entire data block is received from Intel8251, and then a service request is made to the GPIB controller with the help of the SRQ line of GPIB; after the GPIB controller executes the serial query sequence and responds to the converter service request, the received data block can be output to the listening device (or controller) of the GPIB system through MC68488. Note that when receiving a data block from RS232C, the last byte identification mark must be agreed upon.
4 Interface conversion application examples
PCB program-controlled probe positioning equipment is a device that locates the test point of the tested printed circuit board. With the support of a computer, it automatically locates at the tested point and penetrates the protective layer of the printed circuit board to obtain the electrical signal of the tested point. Its composition structure is shown in Figure 3. Its positioning function is realized by the system main controller through the GPIB bus, and the power supply, signal source and test instrument of the PCB are determined by the characteristics of the specific PCB under test. The program-controlled probe positioning equipment uses stepper motor open-loop control to realize the free movement of the probe in the X and Y directions, and uses electromagnet suction control to realize the up and down movement of the probe. The probe penetrates the PCB solder mask layer by scratching to maintain reliable contact with the test point. The microprocessor circuit board of the positioning equipment is an outsourced product, which can realize the control of the stepper motor displacement and electromagnet suction. In addition, the RS232C interface has been designed in the microprocessor circuit board, which can realize serial communication with the main control computer of the test system. However, in ATS, GPIB control is usually used for program-controlled desktop test equipment, so GPIB-RS232C interface conversion is required. The interface conversion circuit designed by the above method can ensure that the PCB program-controlled probe positioning device is connected to the GPIB bus and smoothly connected to the ATS. In addition, in addition to using the GPIB interface, the program-controlled signal can directly use the RS232C control method to complete all functions of the PCB program-controlled probe positioning device by unplugging the RS232C plug connected to the interface conversion circuit board with an external cable, and the GPIB control is invalid at this time.

References

1 Yang Anlu et al. Electronic Instrument Interface Technology. Chengdu: University of Electronic Science and Technology Press, 1994
2 Liu Wenyan et al. Modern Test System. Changsha: National University of Defense Technology Press, 1995
3 Zhang Naiguo et al. Practical Electronic Measurement Technology. Beijing: Electronic Industry Press, 1996
4 Wang Gefang et al. Integration and Development of General Automatic Detection System for Electronic Equipment. Journal of Electronic Measurement and Instrumentation, Vol. 14, No. 5, 2000 (10)
5 Wang Gefang et al. Research on Automatic Detection Technology for Printed Circuit Diagnosis. Systems Engineering and Electronic Technology, Vol. 23, No. 2, 2001

Reference address:Design and application of interface conversion based on single chip microcomputer

Previous article:Using MAX551 to realize program-controlled spectrometer amplifier
Next article:Application of CAN bus in locomotive monitoring system

Latest Analog Electronics Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号