Jul 11, 2022 پیام بگذارید

Introduction And Working Principle Of USB To Serial Port

Introduction and working principle of USB to serial port


1. Introduction


The USB to serial port can realize the mutual conversion between the computer USB interface and the physical serial port. USB to serial port can add a serial port to a computer without a serial port or other USB hosts. When using a USB to serial port device, it is equivalent to turning a traditional serial port device into a plug-and-play USB device.


USB virtual serial port application features:


①USB is widely used, supports hot-plug function, and has fast transmission speed.


②Simulate the standard serial port, which can be used to upgrade the original serial port device, or add additional serial port through USB.


③The serial port application program is fully compatible, no need to modify.


④Support various operating systems, such as: Windows/Linux/Android/macOS.


2. Working principle


After the USB host detects that the USB-to-serial device is inserted → reset the device → start the USB enumeration process.


During USB enumeration, the process will obtain different descriptors such as device descriptors, configuration descriptors, interface descriptors, and so on. It will contain information such as the manufacturer ID, device ID and Class category of the USB device. The operating system will match the corresponding USB device driver for the device according to this information.


The realization of the USB virtual serial port depends on the USB to serial port driver on the system, which is generally provided directly by the manufacturer, or the CDC serial port driver that comes with the operating system can also be used.


The driver is mainly divided into 2 functions:


①: Register the USB device driver to complete the control and data communication of the USB device;


②: Register the serial port driver to provide the corresponding implementation method for the serial port application layer.


The corresponding driver data flow direction of serial port transceiver:


The flow direction of serial port sending:


Serial port application sends data → USB serial port driver obtains data → driver sends data to USB serial port device through USB channel → USB serial port device receives data and sends it through serial port


The flow direction when the serial port receives:


The USB serial device receives serial data → uploads the serial data to the USB host after packaging the serial data through USB → the USB serial driver obtains the serial data uploaded through the USB → the driver saves the data in the serial buffer and provides it to the serial application for reading


usb to serial cable


ارسال درخواست

whatsapp

teams

ایمیل

پرس و جو