Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
323 views
in Technique[技术] by (71.8m points)

Use serial UART output as input in other serial terminal on Windows 10

I would like to use UART communication to synchronize the clocks of two microcontrollers of different manufacturers. How can I relay outputs from one microcontroller to the other, as input? (Windows 10)

Are there specific programs I should use? Currently both microcontrollers can communicate with their own Putty terminals, but I would like to let them communicate with each other as well.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Your goal here is, once you have both microcontrollers connected to your Windows 10 PC and communicating correctly, forward data from one of them to the other through your computer (in a kind of man-in-the-middle or sniffer arrangement).

You can accomplish that easily with Termite, following these steps:

-Download and install Termite from here: https://www.compuphase.com/software/termite-3.4.exe

-Open two instances of the software and go to "Settings" and make sure the parameters of your serial ports are correct (baud rate, data bits, stop bits)

-On one of the ports, in the same settings dialog box choose the other port under the option "Forwarding"

-Click on the bottom with the port parameters on each instance of Termite to open the port and establish the forwarding link

Quoting from Termite's manual:

With forwarding set up, all data received on the primary port is transmitted through the forward port. All data received on the forward port is transmitted through the primary port. The "sent/received colouring" of Termite is also still in effect: data received on the primary port is in green and data received on the secondary port is in blue.

In this configuration, Termite would typically only be used to monitor the communication between two devices. If you type in text on the edit line and transmit it, this text is only sent through the primary port.

EDIT: I made a quick test of the setup above and I realized there is actually no need to open two instances of Termite. You just have to setup one of the ports and select the other as the forwarding output.

I tested sending text from a serial port on a SBC (minicom Linux window in the screenshot), receiving on COM4 and forwarding to COM5 on a Windows 7 VM. The characters are indeed forwarded to COM5 (scope picture). So the chain is as follows:

SBC Serial (minicom)--->Termite COM4--->Termite COM5--->Oscilloscope

This can be indeed used a very simple serial port sniffer.

Serial Port Forwarding Test Scope Capture Serial Output


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...