Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dome中用rs485开启偶校验发送数据,接收方收到的数据与发送数据不一样 #24

Closed
laomuzhu opened this issue Jun 12, 2023 · 1 comment
Labels
question Further information is requested

Comments

@laomuzhu
Copy link

在demo中用rs485开启偶校验发送数据,接收方收到的数据与发送数据不一样。
demo中发的01 04 00 01 00 15 60 05 ,串口调试助手收到的是01 10 01 15 15,用rs232测试不会出现这个现象,只有485会,请问是什么问题呢?

@xmaihh
Copy link
Owner

xmaihh commented Jun 14, 2023

首先,能够接收数据,但是数据错误,说明串口通信成功了。

1)RS232 是全双工的 发送和接收可以同时进行
2)RS485 是半双工的,发送和接收不能同时进行,发送和接收切换开关需要控制
3)信号干扰、传输距离太远、通信速率过高等原因导致数据传输出现错误

在您的情况下,您可以尝试以下措施:

  1. 增加线缆的屏蔽性能或使用双绞线来减少信号干扰;
  2. 缩短通信距离或使用信号放大器来增强信号;
  3. 降低通信速率;
  4. 检查RS485发送和接收的电路和程序是否正确;
  5. 如果可能,请使用逻辑分析仪或示波器等工具来分析信号。

@xmaihh xmaihh added the question Further information is requested label Sep 20, 2023
@xmaihh xmaihh closed this as completed Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants