Arm7 USB编程
我们正在开发一个发送器设备,带有arm7(当前:LPC2368)。
该设备采样一个mv信号,A/D,并需要将该信号数据发送到PC。(连续)
同时,PC需要向arm7发送命令(如获取温度,控制状态等。)
rs232是太慢了,所以我们选择USB。(20K/s - 200K/s)
但问题是,我们不知道如何进行USB编程(PC和ARM..)
有什么方向吗?任何门户网站?有教程吗?
目前我们仅将设备模拟为 HID......
we are developing a sendor device, with a arm7(current: LPC2368) .
this device samples a mv signal,A/D, and need to send this signal data to the PC.(continusly)
at the same time, PC need send command to arm7 (like get temperature, control status, etc..)
rs232 is too slow, so we choose USB.(20K/s - 200K/s)
but the question is, we donnot known how to do usb programming(both pc and arm..)
any direction? any portal? any tutorial?
currently we only sim the device as a HID....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于 ARM 端,您需要一个 USB 堆栈。对于 PC 端,您需要实现 USB 驱动程序和连接该驱动程序的应用程序。因此,更容易坚持使用一种常见的配置文件(HID、大容量存储、虚拟 COM)。对于所有这些,您将能够找到 USB 堆栈,而不必实现自己的。此外,您也不需要为 PC 实现 USB 驱动程序。
我认为最简单的方法是使用虚拟 COM 方法。从 PC 端来看,您可能正在访问串行端口。但速度可能高于标准 RS232 端口。我发现这个 USB 堆栈 针对早期处理器。您可以根据您的需要对其进行调整或将其用作参考。通常,PC 的虚拟 COM 驱动程序将与 ARM USB 堆栈一起提供。
另一种方法是使用 libusb。这将允许您与 USB 交互,而无需编写内核驱动程序。
有关应用说明和商业 USB 堆栈,请查看此处。如果您决心编写自己的堆栈和驱动程序,Jungo 是行业领导者嵌入式 USB 堆栈和驱动程序。
For the ARM side you need a USB Stack. For the PC side you need to implement an USB driver and an application interfacing the driver. It is therefore easier to stick to one of the common profiles (HID, Mass Storage, Virtual COM). For all these you will be able to find USB stacks and not to have to implenent your own. Also you won't need to implement a USB driver for the PC.
I think that the easiest thing to do is to use a Virtual COM approach. From the PC side it would like you are accessing a Serial Port. The speed however can be higher than standard RS232 ports. I have found this USB Stack targetting an earlier processor. You could adapt it for your needs or use it as reference. Generally a Virtual COM driver for the PC will be provided along with the ARM USB stack.
Another approach is to use libusb. This will allow you to interact with USB without writing a kernel driver.
For application notes and commercial USB stacks look here. If you are determined to write your own stack and driver, Jungo is the industry leader for embedded USB stacks and drivers.