Using MC145026/27 to realize multi-machine parallel port line communication

Publisher:石头12345Latest update time:2006-05-07 Source: 国外电子元器件 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere

    Abstract: This article introduces the composition principle and implementation method of a parallel port-based multi-machine line communication system implemented using the three-state codec chip MC145026/27, and provides solutions to wireless communication problems between multiple microcomputers, etc. The overall composition and communication method of the system are explained.

    Keywords: Parallel interface wireless communication encoder decoder MC145026/27

1 Introduction

In fields such as telemetry and remote control, microcomputers and microcontrollers are often used to form multi-machine communication systems to complete measurement and control tasks. Among them, the commonly used method is to use the RS-232C serial interface of a microcomputer for serial data communication. Due to the influence of the environment and the limitations of the electrical performance of the RS-232C serial interface, as well as shortcomings such as long connection lines and troublesome wiring, the spatial range of its communication is always limited and makes people feel inconvenient. Therefore, people thought of wireless transmission. Commonly used wireless transmission methods include wireless shortwave transmission and infrared transmission, but these two methods have certain limitations. For example, the shortwave method is susceptible to interference from external electromagnetic fields, and the external line transmission method cannot be transmitted through walls, etc. This article will introduce the methods used. The latest wireless long-wave transceiver module T630/T631, and the latest three-state codec chip MC145026/MC145027 are used to design wireless data communication devices. The device has the characteristics of good anti-interference performance, strong penetration and long transmission distance. Due to the slow transmission speed of the serial interface and the complexity of the signal processing circuit, it is difficult to connect external modules. Therefore, this device uses parallel interface communication, making the circuit simple and easy to build and highly reliable.

2 System composition

As shown in Figure 1, this device is mainly composed of two modules: data encoding and decoding and transmitting and receiving. Among them, the data encoding and decoding module is used to complete tasks such as input and output of data information, address encoding, address identification, and data parallel/serial conversion; the transmitting and receiving module is used to complete tasks such as modulation, transmission, reception and demodulation of serial data.

2.1 Codec module

The encoding and decoding module consists of three-state encoding and decoding chips MC145026 and MC145027. This set of chips is the latest chip produced by Motorola for communication pairing. The encoding chip MC145026 can encode 9-bit input information (address bits A1~A5, data bits D6~D9). After encoding, each data bit is represented by two pulses: "1" is encoded as two wide pulses; "0" The encoding is two narrow pulses; the "open" encoding is a wide pulse interleaved with a narrow pulse. When the TE terminal input pulse rises, the encoded data stream begins to be serially output by D0. Each 9-bit data information can be regarded as a data word. In order to improve the security of communication, the encoding and decoding chip sends each data word twice and receives it twice.

MC145027 decoder is used to receive the encoded data stream output by MC145026. When the decoder address and encoder address status are consistent and two sets of identical encoding signals are continuously received, the VT terminal jumps from low level to high level to indicate that the reception is valid, and at the same time interrupts the computer to receive. When the address bit of the received data stream is different from the local address setting, or the data received twice is different, or there is no signal within four data cycles, the VT terminal becomes low level, and it can be considered that there is no signal at this time. The signal or belief is that the signal is not sent to this unit. Since the address identification of the received information is completed by the MC145027 chip, information that is not sent to the local machine is usually not transmitted to the parallel interface, so it will not affect the work of the local machine.

2.2 Transmitting and receiving module

The transmitting and receiving module consists of long-wave digital signal transceiver chips T630 and T631. This set of chips can be used to transmit and receive serial data signals. Long groups can penetrate barriers such as buildings, chassis, and metal equipment. Its transmission power is in the mW level and in the 150kHz frequency band, so it will not interfere with other circuits. At the same time, it is difficult to be interfered by other circuits. Its power supply voltage range is 1.5~20V and can be powered by the +5V pin of the parallel interface. The chip integrates various components including the antenna, and its external circuit and application interface are also very simple.

3 Communication Principles

3.1 Utilization of parallel interfaces

The parallel interface of the microcomputer CENTRONIC printer includes an 8-bit data output register, an 8-bit data input register, a 5-bit control output register and a 5-bit status input register. Writing operations to the interface data output register can achieve the output of 8-bit information; and operations on the interface control register can change the status of the output control lines; reading operations on the interface status input register can obtain the status information of the peripherals. The CENTRONIC parallel interface uses 8 data lines, 4 control lines and 5 status lines when connecting to peripherals. The data line signals are DATA0~DATA7, and the control line signals are "strobe" (STROBE), "initialization" (INIT), "printer input selection" (SLCTIN) and "automatic paper feed" (AUTOFDXT). Among them, when the SLCTIN signal is low level, it means using the parallel interface to transmit data information to the printer; when STROBE generates a negative pulse signal, it means strobe the printer, then the printer will receive the data signal on the data line; INIT signal and AUTOFDXT The signal is not used during normal data transmission and its status always remains unchanged. Status signals include: "BUSY", "ERROR", "Paper Out" (PE), "Select" (SLCT) and "ACK" (ACK). It can be seen that the CENTRONIC parallel interface can complete an 8-bit data output, a 4-bit control signal output and a 5-bit status signal input. Here, consider the parallel interface as a general-purpose I/O connection between the encoder and decoder.

3.2 Communication method

When using encoders and decoders to realize communication between a PC and a microcontroller, it is necessary to configure an encoder and a decoder on the PC and the microcontroller respectively to complete the sending and receiving of data signals. Since MC145026/MC145027 can complete the sending or receiving of 4-bit binary data information at a time, and computers often use data in bytes, it is necessary to divide 1 byte into high nibble and low nibble into 2 Send or receive times. Figure 2 is its communication schematic diagram.

The address of the encoder MC145026 in the figure is the address of the receiver, which can be set by software through the parallel interface. Therefore, each transmitter can have multiple (this device uses 4 address bits, so there can be 2 4 = 16) receivers to respond to it. The address of the decoder MC145027 is also the address of the local machine, which is set by the hardware component micro switch group DIP. The address of the decoder MC145027 determines the communication address of the local machine. It is unique for each microcomputer, so it can only receive information containing the local machine address.

On the interface between the microcomputer and the encoder, the high 4 bits DATA4~DATA7 of the printer parallel interface data line configured with the microcomputer can be directly connected to the D6~D9 data input lines of the encoder, and the INIT control line is used to connect the encoder data Send allows pins to be connected. Since the encoder address bits are 5 bits, and the parallel interface data output register is 8 bits, only 4 address bits can be used. This is why the A0 pin of the encoder MC145026 in this device is connected to high level (the decoder MC145027 A0 pin should also be connected to high level). When sending data, the microcomputer writes half a byte of address information to the lower 4 bits of the parallel interface data output register, then writes half a byte of data information to the upper 4 bits, and then writes the control output register to Make the INIT signal low level, thus completing the output of 4-bit data.

On the interface connection between the microcomputer and the decoder, the status lines ACK, ERROR, PE, and SLCT of the parallel interface should be connected to the data lines D6~D9 of the decoder respectively, so that the microcomputer can read the decoder output through the status lines. data, and use the status line BUSY to connect to the data output valid pin VT of the decoder, so that the microcomputer can check whether the status bit BUSY in the parallel interface status register is high level to check whether the decoder is currently receiving Whether the incoming data is valid and get the data received by the decoder.

4 Main parameters of the system

The modules that control the baud rate in this system mainly include the codec chip MC145026/MC145027 and the long-wave transceiver module T630/T631. The carrier frequency of the long-wave transceiver module is 150kHz, so it is not a major constraint. The maximum data transmission rate of the codec chip MC145026/MC145027 is 6400b/s.

When used together, the codec chip MC145026/MC145027 requires that the clocks of the two are basically the same, but this requirement is not very strict. The relationship between the external resistance and capacitance and the oscillation frequency is as listed in Table 1.

Table 1 Relationship between external resistors and capacitors and oscillator frequency

fosc/kHz Rtc/kΩ Rs/kΩ R1/kΩ C1 R2/kΩ C2
262 10 20 10 470 100 910
181 10 20 10 910 100 1800
88.7 10 20 10 2000 100 3900
42.6 10 20 10 3900 100 7500
21.5 10 20 10 8200 100 15×10 3
8.53 10 20 10 2×10 4 200 2×10 4
1.71 50 100 50 2×10 4 200 10 5

5 Conclusion

This device overcomes the problem of mutual interference during multi-machine wireless communication, so the communication reliability is high, and can be used in communication systems, alarm systems, data acquisition systems, LED large-screen display systems, remote control systems and other fields. In terms of the interface with the microcomputer, this device cleverly utilizes the parallel interface of the microcomputer printer, so it is very simple, convenient and easy to implement.

Reference address:Using MC145026/27 to realize multi-machine parallel port line communication

Previous article:Low power VHF wireless communication receiver MICRF004 and its application
Next article:Research on the stability of single-chip multi-computer communication system

Latest Industrial Control 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号