Introduction
RS485 circuit is a common serial communication interface standard, widely used in industrial control environment. It uses balanced transmission and differential reception, has the ability to suppress common-mode interference, is suitable for the communication distance from tens of meters to thousands of meters, and performs well in multi-node systems.
In the field of industrial control, RS485 bus is often used to connect various devices, such as sensors, actuators, etc. Through differential transmission mode, RS485 bus can effectively resist common mode interference to ensure stable data transmission. In addition, the RS485 circuit can also isolate the system power supply and the transceiver power supply through the isolation device, further enhancing the stability and safety of the system.
The SSP485 chip is a classic +5V low-power half-duplex RS485 transceiver with data transfer rates of up to 2Mbps. +3.3V power supply, the maximum transmission rate is recommended to 500Kbps. The SSP485 has a fail-safe circuit with +15kVESD electrostatic discharge protection.
The SSP485 receiver has 1/8 input impedance per unit load, and up to 256 transceivers can be attached to the bus. It is mainly used in RS-485/RS-422 communication system.
SSP485 chip pin diagram is as follows:
(SSP485 pin diagram)
Pin description is as follows:
(Pin Assignment)
SSP485 circuit diagram is as follows:
(SSP485 circuit diagram)
SSP485 typical circuit We can see, RE and DE are connected together, controlled by the MCU control pin, RX and TX are MCU serial signals, respectively, connected to the SSP485 RO and DI pins.
- When the control signal is high and the RE logic is 1, SSP485 is enable for sending:
When TX is high, output A is high, and output B is low, that is, output 485 logic 1;
When TX is low, the output A is low and B is high, that is, the logical 0 of the output 485.
- When the control signal is low and the RE logic is 0, SSP485 is enabled for receiving:
When A-B≥-50mV on the 485 bus, RX is high and logic 1 is received.
When A-B≤-200mV on the 485 bus, RX is low and logical 0 is received.
Optocoupler isolation circuit
(Isolation circuit diagram)
VCC_MCU and VCC2 are two groups of non-common power supply, through the optocoupling isolation to achieve the isolated transmission of signals, SSP485 and MCU are not common, completely isolated and effectively inhibit the generation of high common mode voltage, thus greatly reducing the 485 chip damage rate, improve the stability of the system. But there are also many circuit devices, short life, weak resistance to common mode, high power consumption, transmission rate is limited by photoelectric devices and so on.
Digital isolation circuit
(Isolation circuit diagram)
Automatic transceiver circuit
(Circuit diagram)
The automatic transceiver circuit adds a typical triode switching circuit on top of the 485 circuit.
- Send data
If we want to send data 0x72, we write it as binary 0x01110010, and the TX pin will be high and low to reflect 1 and 0.
When the TX pin is 0, the transistor is not on, DE is high, and the driver state is entered. If the DI pin is grounded, the differential level logic between ABs is 0;
When the TX pin is 1, the transistor is on, RE is low, and enters the receiver state, and the A and B pins are in the high impedance state, because of the action of the pull-up resistor Ra2 and the pull-down resistor Rb2, the differential level logic between AB is 1.
- Received data
When receiving data, the RX pin of the MCU is used. When receiving data, the TX pin remains high, the transistor is on, the RE is low, and it enters the receiver state. The RX pin will receive the data transmitted from the AB end.
The on delay of the transistor is ns level, and the off delay is us level, which will lead to a longer delay time of the low level of the transceiver circuit, followed by the high level of transmission is driven by the external pull up and down resistance, and the higher the resistance, the slower the rising edge.
Assuming that the bit sent on the TX pin is 0 and the bit to be sent is 1, the transceiver switches to the receiving state because the high level of transmission is driven by an external pull-down resistor. It takes a few hundred ns for the AB line to switch from low to high, and the RX pin will receive 0 during this time. If the baud rate is too high, the low level received by the RX pin will be mistaken for the receiving start bit, resulting in abnormal communication. Therefore, the actual circuit is measured, and the automatic transceiver rate of 128000bps and below can be normal communication.