Location>code7788 >text

USB and CAN both use differential signals to transmit data, so why can CAN transmit so much farther than USB?

Popularity:534 ℃/2024-09-30 19:42:14

Difference between USB and CAN

Today, while looking at the USB project design examples, a question suddenly came to mind, which triggered some thoughts. After thinking about it plus checking the information, I wrote this article as a record.

concern

Both USB and CAN use two wires as differential lines for data transmission with differential signals. It is always known that differential signaling has a strong anti-interference capability. Then why the general transmission distance of USB is 5 meters, the maximum is 10 meters (USB2.0 vulgar mode). While the general transmission distance of CAN is several hundred meters or even more than 1KM.

make a distinction

  • Power supply:
    • USB not only transfers data, but the master device can also provide 5V power to the slave devices.
    • CAN can only transmit data
  • Transmission rate:
    • The transfer rate of USB2.0 can reach up to 480Mbps, and the transfer rate of USB3.0 can reach 5Gbps.
    • The transmission rate of the CAN protocol is relatively low, depending on the baud rate of the CAN configuration, typically in the range of 1 Mbps.
  • Topology:
    • USB with star topology (one master, many slaves mode)
    • CAN utilizes a bus mode and reduces reflections through termination resistors, thus ensuring that signals can be transmitted over longer distances.
  • Protocol design (GPT supplement, which I also agree with)
    • USB: Transmits data directly after the connection is established, with no message specification or redundancy check mechanism, and no retransmission mechanism
    • CAN: Sends signals into the bus, where CAN messages have a 15-bit RCR checksum code to better detect data distortion due to interference during data transmission and to retransmit them according to the retransmission mechanism.

solution

  1. Transmission rate: CAN has a relatively lower transmission rate, and a lower transmission rate means that theLonger duration of the level signalThe data reliability can be effectively enhanced.
  2. Topology: CAN has a 120Ω termination resistor at each end of the bus, which reduces signal reflection and improves signal integrity.
  3. Protocol design: CAN has a good error detection mechanism and retransmission mechanism (CRC checksum, delimiter checksum, manual or automatic retransmission).

The above three points make CAN more advantageous than USB in transmission distance, if there are mistakes in the article, welcome to criticize and correct. If you have any new ideas, please leave your bold ideas in the comment section.