虚拟 COM 端口还是使用原始端点? [英] Virtual COM port or using raw endpoints?
问题描述
我正在带有 USB 控制器和代码示例的微控制器中开发软件以实现虚拟 COM 端口.
实现是一种来回传输数据的设备,我正在考虑使用 2 个批量端点,在我的计算机中使用 libusb 来读取和写入它们.
虚拟 COM 具有不需要 libusb 的优势,因为它已经存在驱动程序,并且可以通过与 com 端口接口进行通信(在这种情况下仅适用于 Linux).
就数据传输而言,最快的是什么?我知道两者都是使用 2 个批量端点的实现(虚拟 com 也使用中断,不确定我现在是否需要它).是否有可能,即使使用虚拟 com 端口有效负载,传输速率也与使用 2 个批量端点实现某些东西相同,而没有 USB 类?
你认为我在做出这个决定时还有什么遗漏吗?
要实现虚拟 COM 端口,您还必须使用 USB 类 USB CDC ACM.
https://en.wikipedia.org/wiki/USB_communications_device_class
查看 UART 标准波特率 https://electronics.stackexchange.com/questions/9264/what-standard-uart-rates-are-there
110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 230400, 4602800, 4602800, 4602800, 4602800, 19200, 57600, 115200, 230400, 4602800, 有时会出现高频率的问题,0>/p> 使用 USB CDC ACM 时,设备将被识别为(虚拟)COM 端口并可通过终端访问 批量传输是以最高速度传输数据的最简单方法,可以与大容量存储设备类 https://en.wikipedia.org/wiki/USB_mass_storage_device_class 设备将被识别为大容量存储(普通驱动器,如 U 盘) 请参阅此http://www.beyondlogic.org/usbnutshell/usb4.shtml#Bulk 如果您需要 Atmel MCU 的示例和源代码,请参阅 LUFA 库 (http://www.fourwalledcubicle.com/LUFA.php) 或查看嵌入式操作系统,例如 Contiki OS.其中包括其他 MCU(如 MSP430)的 USB 源代码,...还有 I'm developing software in a microcontroller with a USB controller and code example to implement a Virtual COM port. The implementation it's a device that transfer data back and forth and I was thinking about using 2 bulk endpoints, using libusb in my computer to read and write in them. The virtual COM would have the advantage of not needing libusb since the driver it's already there and communication would be done by interfaciing with a com port (in this case is Linux only). In terms of data transfer, what would be fastest? I understand that both would be implementations using 2 bulk endpoints (virtual com uses an interrupt as well, not sure if I need it now). Is it possible that, even with virtual com port payload, that transfer rate will be the same as implementing something using 2 bulk endpoints, with no USB class? Any other point you think I'm missing to make this decision? To implement a virtual COM port you also have to use a USB class USB CDC ACM. https://en.wikipedia.org/wiki/USB_communications_device_class See this for UART standard baud rates https://electronics.stackexchange.com/questions/9264/what-standard-uart-rates-are-there 110, 300, 600, 1200, 2400, 4800, 9600, 14400, 19200, 38400, 57600, 115200, 230400, 460800, 921600,... High baud rates sometimes make problems When using USB CDC ACM the device will be recognized as (virtual) COM port and can be accessed via a termin bulk transfer is the easiest way to transfer data at maximum speed and can be used with the mass storage device class https://en.wikipedia.org/wiki/USB_mass_storage_device_class The device will be recognized as mass storage (normal drive like a USB stick) See this http://www.beyondlogic.org/usbnutshell/usb4.shtml#Bulk If you need examples and source code for Atmel MCU see the LUFA library (http://www.fourwalledcubicle.com/LUFA.php) or check out the embedded operating systems like Contiki OS. These include USB source code for other MCUs like MSP430,... also 这篇关于虚拟 COM 端口还是使用原始端点?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!