如何证明 RS 232 全调制解调器工作、RS 422 工作 PC 到 PC 和环回

发布于 2024-11-30 14:41:14 字数 261 浏览 3 评论 0原文

你好,我是一名新手,试图证明 RS 232 全调制解调器和一个 RS 422(RX、TX、RTS、CTS)的工作原理,

这 2 个端口位于定制设计的板上,我需要证明它们正在工作。

我能够在寄存器级别确认工作,但我需要使用 Minicom 或任何其他自定义程序等软件来证明工作。

我如何使用 DB 9 连接和环回来证明这些端口从一台 PC 到另一台 PC 的工作

有人可以帮助我吗?我需要使用任何额外的硬件来证明它在 Linux 中的工作原理吗?

Hello there I am a newbie trying to prove the working of RS 232 Full modem and also one RS 422( RX,TX,RTS,CTS)

These 2 ports are on a custom designed board and I need to prove they are working.

I am able to confirm the working at register level but I need to prove the working using softwares like Minicom or any other custom program.

How can I prove the working of these ports from one PC to a different PC using DB 9 connections and LOOP BACK too

Can someone help me with this? Do I need to use any extra hardware to prove the working of this in Linux?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

友欢 2024-12-07 14:41:14

最常见的串行端口测试类型可能是环回测试。创建一个测试夹具,将端口的输出引脚连接到输入引脚(TX->RX、RTS->CTS 等)。如果每个输出引脚没有匹配的输入引脚,则需要进行三路连接。

创建环回后,您将需要编写应用引脚的软件。如果 TX 和 RX 连接,您可以发送一个字节并验证它是否已回显。对于控制引脚,切换它们并确保连接的另一侧看到过渡。 确保使用串行端口的每个引脚。

请注意,您应该以多个波特率运行 TX->RX 数据环回。设计中的信号完整性问题仅在较高波特率下出现。板上也可能存在不良信号连接,该信号连接被较高波特率下的电感和电容所掩盖。因此,最好以最慢的波特率、最快的波特率以及中间的 1-2 波特率运行数据环回。

您应该做的另一件事是波特率精度测试。这将证明驱动 UART 的时钟以正确的频率运行,并且被正确分频。以特定波特率传输 X 个字节,并验证它们在预期时间内到达。为了获得准确的数字,您需要绕过操作系统串行端口驱动程序中的任何缓冲(例如使用直接寄存器 I/O),并确保适应任何起始/停止位开销(请参阅下面的注释)。

但是,环回测试并不详尽。它仅证明设备可以与自身通信。该设备可能仍然存在一些无法在本地检测到的缺陷(例如电压水平)。因此,您还应该使用外部硬件运行一些测试。将您的板连接到另一个系统并运行测试(例如使用 minicom)。确保他们可以互相交谈。

即使是外部通信测试也可能会错过一些东西。您的主板的信号质量仍然可能很差,但对于其他设备来说它恰好足够好。 要准确验证信号质量/时序,您需要一台示波器。

在运行通信测试时,将示波器探头连接到各种信号并验证信号完整性。确保电压电平有效,您可以看到清晰的低/高位转换,并且数据引脚的时序对于指定的波特率来说是正确的。 (与前面描述的基于软件的方法相比,示波器是一种更准确的波特率测量方法。)

The most common type of serial port test is probably a loopback test. Create a test fixture that connects output pins of the port to the input pins (TX->RX, RTS->CTS, etc). If you do not have matching input pins for every output pin, you will need to do a three-way connection.

After you create the loopback, you will need to write software that exercises the pins. If TX and RX are connected, you can send a byte and verify that it was echoed back. For the control pins, toggle them and make sure the other side of the connection saw the transition. Make sure you exercise every pin of the serial port.

Note that you should run a TX->RX data loopback at multiple baud rates. It is possible for there to be a signal integrity issue in the design that only shows up at higher bauds rates. It is also possible for there to be a bad signal connection on the board that is masked by inductance and capacitance at higher baud rates. Therefore, it is a good idea to run a data loopback at the slowest baud rate, the fastest baud rate, and 1-2 in the middle.

Another thing you should do is a baud rate accuracy test. This will prove the clock driving the UART is running at the right frequency, and being divided properly. Transmit X amount of bytes at a certain baud rate and verify they arrived in the expected amount of time. To get an accurate number, you will need to bypass any buffering in the OS serial port driver (e.g. use direct register I/O), and make sure to accommodate for any start/stop bit overhead (see comments below).

However, a loopback test is not exhaustive. It only proves the device can talk to itself. The device may still have some flaw (e.g. voltage levels) that cannot be detected locally. So, you should also run some tests with external hardware. Cable your board to another system and run a test (e.g. with minicom). Make sure they can talk to each other.

Even an external communication test can miss something. You can still have poor signal quality from your board, but it happens to be good enough for the other device. To accurately verify the signal quality/timing, you need an oscilloscope.

While you are running communication tests, connect the scope probes to the various signals and verify the signal integrity. Make sure that voltage levels are valid, that you see clean low/high bit transitions, and that the timing of the data pin appears correct for the specified baud rate. (A scope can be a more accurate way to measure baud rate than the software-based method described earlier.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文