ADetectionsystemBasedonMC145027forGroupAnalogueSignal

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

    Abstract: Introducing a group analog signal detection system based on MC145027. This system can connect each probe and the host through a single signal line. The number of probes can reach up to 242 channels; the special coding method of MC145027 can make the data in It has extremely high reliability during the transmission process, which has high application value in industrial sites with strong electromagnetic interference.

    Keywords: multi-point detection; single signal line; reliability; MC145026; MC145027

    In industrial automation control systems, it is often necessary to detect multi-point analog quantities. The traditional method is to set up sensors at each detection point and connect them to the host computer with three or two lines, and use multiple analog switches and analog-to-digital conversion devices to detect each analog signal. Perform analog-to-digital conversion to obtain the corresponding data for host processing. This method has the following shortcomings:

·The analog voltage is susceptible to interference during the process of being transmitted to the host through the cable;

·The host must select the sensor through an analog switch, which limits the number of probes and the interface circuit of the host is relatively complex;

·The host cannot transmit control instructions to each detection point;

·If a sensor is added to the detection point, a cable must be added to the host, thus increasing the wiring complexity;

    In response to the above problems, the author designed a group analog signal detection system based on MC145027, which enables two-way data transmission between the host and each probe through only three lines (as shown in Figure 1). Because the special decoding method of MC145027 can eliminate instantaneous strong electromagnetic interference, the data has high reliability during transmission.

   1. MC145027 decoding method

    MC145027 is usually used as a decoder, and the encoder used with it is MC145026. In order to explain the decoding method of MC145027, here we first introduce the encoding method of MC145026.

    1.1MC145026 encoding

    The pin functions and external circuit of the integrated encoder CM145026 are shown in Figure 2. A1~A9 are address or data input terminals. When used as addresses, they have three states (high level, open circuit, low level). When used as data, they have two states (high level, low level); , The value determines the operating frequency of the MC145026 internal clock oscillator;TE is the working control end of the internal clock oscillator. When TE is low level, the oscillator works;The output encoding signal is shown in Figure 3. Two consecutive wide pulses (duty ratio 7:1) represent "1", two consecutive narrow pulses (duty ratio 1:7) represent "0", and one wide A narrow pulse of two indicates an "open circuit". When sending, first send the low level for 17.5 clock cycles, and then send the status codes of A1 to A2 in sequence. If TE is still low level after the status codes of A1 to A9 are sent, send them in sequence after 24 clock cycles. Status codes of A1~A9. No matter when TE changes from low level to high level, its coded sending work must wait until the end of the current sending cycle to stop [1].

    1.2MC145027 decoding method

    MC145027 is a kind of decoder (MC145027/145028) used in conjunction with MC145026. It has 4-bit data output and 5-bit address encoding. It can generatedifferent address codes. Different combinations of their addresses can generatedifferent address codes. The pin functions and external circuit of MC145027 are shown in Figure 4, and its functional block diagram is shown in Figure 5.

    MC145027 uses an RC integrating circuit to complete the identification of wide and narrow pulses. In Figure 5, the timing components R1 and C1 determine the identification of wide and narrow pulses. . R2 and C2 are the identification timing components of the entire transmission cycle, used to determine each valid word . When the encoding signal is input from the data input terminal (pin 9), the same signal as pin 9 will appear on pin 6. The signal is integrated by R1 and C1 integrating circuit and sent to the data extraction circuit through pin 7. The data extraction circuit inputs the signal Each rising edge detects the status of pin 7 to determine whether the input is a wide pulse or a narrow pulse. Figure 6 shows the waveforms of the pin 6 and pin 7 signals. It is assumed that the data input terminal inputs an "open circuit" code (i.e. a wide pulse and a narrow pulse). The wide pulse starts at time t0 and ends at time t1, and the narrow pulse It starts at time t2 and ends at time t3, and the entire encoding ends at time t4. Then, at time t1, the voltage at pin 7 is:

   At this moment, the level of pin 7 detected by the data extraction circuit is high, indicating that the previous pulse is a wide pulse; after that, the narrow pulse charges C1 through R1. At the end of the narrow pulse at t3, the voltage of pin 7 is 0.74Vcc. In the following period of time, C1 is discharged through R1. At the t4 moment when the encoding ends, the voltage of pin 7 is 0.1Vcc. At this time, the data extraction circuit detects that the level of pin 7 is low, indicating that the previous pulse is a narrow pulse. It can be seen that the MC145027 does not directly decode the received pulse signal, but decodes the input signal after integrating it. Since the integrating circuit can filter out the instantaneous spike interference, even if the encoded signal received by the MC145027 is affected by some program Despite interference, MC145027 can still perform correct decoding, which is particularly important for industrial sites with complex environments.

    2. Design of system hardware circuit

    The hardware circuit of the detection system includes a probe circuit and a host interface circuit. The transmission format between the host and the probe follows the MC145026 encoding format.

    2.1 Probe circuit

    The schematic block diagram of the probe circuit is shown in Figure 7 .

    The encoding signal line sent by the host to the probe is transmitted to each probe through the signal. After being processed by the amplification and shaping circuit, it is sent to MC145027 for decoding. When the address is determined to be consistent, VT changes from low to high to apply for an interrupt to the microcontroller, and the microcontroller reads the decoded data, MC145027 can decode the 4-bit data code, and the 4-bit binary data code can representAccording to the command, the microcontroller will output the collected data (temperature, pressure, humidity, etc.) through P1.7 according to the encoding format of MC145026, and then send it back to the host through the drive circuit.

     2.2 Host interface circuit

Using a 486 or 586 microcomputer as the host computer, the host interface circuit for exchanging data with the probe through the parallel printing port is shown in Figure 8 . The status of the A1~A5 pins of MC145027 determines the host's address code (00000). D6~D9 are connected to pins 13, 12, 10, and 11 of the host's printing port respectively. The above four pins are the printer's status input ports. The port address is 379H (279H), corresponding to D4~D7 of the host data bus. The host sends commands to each probe through pin 14 of the printing port (port address 37AH/27AH, corresponding to data bit D1). After receiving the command, the probe returns the required data to the host, which is decoded by MC145027 and read by the host. The VT pin of MC145027 is connected to pin 1 of the printing port (port address 37AH/27AH, corresponding to data bit D0). The host determines whether response data has arrived by regularly detecting the status of the VT pin.

   3. Software design

    3.1 Definition of data format

    According to the encoding format of MC145026, 9 bits of data information can be sent in one transmission cycle. We define A1 to A5 as the address information of the probe and the host. Since a total of 243 address codes can be represented, and the address code of the host is defined as 00000, so The remaining 242 address codes can be used by the probe; in the code sent by the host to the probe, in addition to A1 ~ A5 representing the address of the probe, there are 4 bits A6 ~ A9 that can represent the control command, which can be composed ofThese 16 command codes can be defined one by one according to the system requirements during design for system use. In the code sent by the probe to the host, the first five digits A1~A5 are in the fixed format 00000, indicating the address number of the host. The last four digits A6~A9 indicate the data sent to the host. One byte is sent in two times, with the high value sent first. nibble (high four bits), and then send the low nibble (lower four bits).

    3.2 Setting of probe address code

    The address input pins (A1~A5) of MC145027 have three states (high level, flat, low level), which means that the address line is ternary data, while the I/O port of the microcontroller is binary state (binary data format ), in the probe circuit, in order to make the address code sent by the microcontroller correspond to the address code of MC145027, the microcontroller must be able to automatically detect its own address. In the circuit shown in Figure 7, P1.0~P1.6 are used as address setting pins, and the address information they represent should be the same as the address of MC145027 (A1~A5), which involves binary to ternary conversion. question. Since 8-bit binary data is required to represent 243 addresses, the microcontroller only has 7-bit address setting pins, and the other bit (the highest bit) can only be set by the program. In this way, the address of the probe can be set more flexibly, so it has a certain degree of versatility.

    3.3 Software design of microcontroller

    The microcontroller in the probe circuit is mainly used to complete the following functions: (1) Complete the self-test of the probe circuit; (2) Receive and execute the control commands sent by the host; (3) Complete the corresponding actions according to the commands of the host; ( 4) Send data to the host according to the encoding format of MC145026.

    3.4 Design of host software

    The host software is the core of the entire control system. Here we only discuss content related to probe communication. Set up a scheduled interrupt program in the main control software to regularly detect the status of the VT pin of MC145027. When the VT pin changes from low level to high level, the data from the probe is received by reading the contents of port 379H/279H. . When the host computer sends a command to each probe, it can send the control command code through pin 14 of the parallel printing port. The sending format of the host command code should also follow the encoding format of MC145026.

   4 Conclusion

    The unique decoding method of MC145027 can effectively overcome the strong electromagnetic interference in industrial sites and ensure reliable transmission of data. Using the microcontroller (or 486/586 host) to imitate MC145026 to send coded data can effectively utilize system resources, save drug costs, and improve the overall system reliability.

Reference address:ADetectionsystemBasedonMC145027forGroupAnalogueSignal

Previous article:Using linear cumulative model to analyze cable insulation life test data
Next article:Digital Thermometer and ThermostatDS1625DigitalThermometerandThermostatDS1625LiNing

Latest Test Measurement 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号