Single-chip long-distance multi-machine serial communication application

The use of single-chip microcontrollers has become increasingly widespread. Many microcontrollers are equipped with a serial communication port, which significantly expands their application scope. For example, the serial port of the 51 series microcontroller is a full-duplex communication interface, allowing both transmission and reception simultaneously. It supports multiple communication modes, such as multi-machine communication, by configuring the Serial Control Register (SCON). In real-world applications, long-distance multi-machine serial communication is often required.

Single-chip long-distance multi-machine serial communication application

According to general descriptions, the connection between the master and slave in multi-machine communication is shown in Figure 1-9. The master queries the slave through software programming. However, this method is limited to short distances—usually within a few meters. This is because the TTL-level signal from the serial port’s TxD output lacks sufficient driving capability and noise immunity for long-distance data transmission. Therefore, to achieve long-range communication (tens of meters to several kilometers), alternative solutions must be adopted.

1. Long-Distance Serial Communication Circuit for Single-Chip Microcontrollers

To enable long-distance serial communication for single-chip microcontrollers, differential drivers and receivers are added at the TxD and RxD ports. This allows differential signal transmission instead of single-ended signaling. After adding the differential driver and receiver circuits, the multi-machine communication setup is shown in Figure 1-10. The empty boxes represent the added differential components. As seen in the figure, after the addition, only the D+ and D− lines remain between the master and the slave, eliminating the need for a shared ground. This reduces the impact of ground potential differences and simplifies cabling. Importantly, the two transmission lines should be twisted pairs to reduce electromagnetic interference.

Single-chip long-distance multi-machine serial communication application

The circuit connects to the microcontroller using three signals: TxD, RxD, and GND. The output consists of two differential signals: D+ and D−. The circuit includes a 74LS04 NOT gate, an MC3487 differential driver, and an MC3486 differential receiver. Capacitors C1 and C2 filter high-frequency noise on the D+ and D− lines, while resistor Ri provides a pull-up for the D+ signal. The MC3487 and MC3486 are compatible with the RS-422A standard, making them suitable for long-distance serial communication. They are available at reasonable prices, with domestic equivalents such as DS3487 and DS3486.

The pin configuration of the MC3487 is shown in Figure 1-4, and its truth table is listed in Table 1-6. It is a four-channel RS-422A transmitter with three-state outputs. Pin 1 is the input for the first driver, while pins 2 and 3 are the non-inverting and inverting outputs. Pin 4 controls the output state. When pin 4 is low, the outputs are in a high-impedance state. The MC3486 is a quad differential receiver with three-state outputs. Pins 1 and 2 are the differential inputs, and pin 3 is the output, which is controlled by pin 4. When pin 4 is high, the output is enabled.

Single-chip long-distance multi-machine serial communication application

Let’s now analyze the operation of the differential driver and receiver circuit in Figure 1-11. Consider a case where the serial port sends data. When TxD sends a low level, it is inverted by the 74LS04 and applied to the control pin 4 of the MC3487. Pin 1 is grounded, so it remains low. According to Table 1-6, at this point, pin 2 is low, and pin 3 is high. These signals are sent over the D+ and D− lines to the remote receiver. At the receiving end, the MC3486 receives a low level on D+ and a high level on D−. This means the non-inverting input is low, and the inverting input is high, resulting in a low output on pin 3. Thus, the RxD of the remote MCU matches the low level sent by the transmitting TxD.

When TxD sends a high level, the 74LS04 inverts it to a low level, putting the MC3487 into a high-impedance state. At this point, the D+ line is pulled up via a resistor, resulting in a high level on D+ and a low level on D−. The remote MC3486 then sees a high level on D+ and a low level on D−, causing its output to go high. From this analysis, it’s clear that the received signal at the remote RxD exactly matches the transmitted TxD level. This ensures consistent signal integrity across the communication link. With the strong drive capability of the MC3487 and the differential reception of the MC3486, the communication range is greatly extended, and the effects of common-mode ground potentials are effectively eliminated.

Ceramic parts

Ceramic Parts,Advanced 95 Ceramic Materials,High Strength Ceramics,Durable Ceramic Components

Yixing Guanming Special Ceramic Technology Co., Ltd , https://www.guanmingceramic.com