K20 USB low-level communication

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

K20 USB low-level communication

跳至解决方案
2,670 次查看
stevea
Contributor I

Greetings All,

I am working on a project with the MK20DX256VLL7 processor.  I have been able to successfully run the FSL_USB_Stack on our custom board using the CDC device (many thanks to BlackNight ).  I also have been able to communicate with a host PC using a virtual comm port. 

However, I need to design this project so that several devices can be connected to a host PC at the same time, and I'd like the user to not have to worry about the specifics of comm ports and the way that Windows auto-increments the number with each new device.  Is the CDC device appropriate for this task, and if so, what driver do I need to call in the .INF file?  Is there perhaps a better device class to use?  We are starting to look at an FTDI chip and driver set, but that seems a little silly considering the K20 already has USB capabilities.

Regards,

--steve

标签 (2)
标记 (2)
0 项奖励
回复
1 解答
2,316 次查看
bobpaddock
Senior Contributor III

I just posted some code to show what COM ports match what USB device:

"How to display com# when USB is plugged in?"

I got tired of answering the support question "What COM port do I have?".

Poking at the registry to prevent the COM port from changing is a dubious process across all the versions of Windows.

Far safer to just use the SetupAPI's as the above link shows.

在原帖中查看解决方案

0 项奖励
回复
7 回复数
2,317 次查看
bobpaddock
Senior Contributor III

I just posted some code to show what COM ports match what USB device:

"How to display com# when USB is plugged in?"

I got tired of answering the support question "What COM port do I have?".

Poking at the registry to prevent the COM port from changing is a dubious process across all the versions of Windows.

Far safer to just use the SetupAPI's as the above link shows.

0 项奖励
回复
2,316 次查看
Teckna
Contributor V

Hi Bob,

I can't see the link, it seems broken.

Many thanks

Teckna

0 项奖励
回复
2,316 次查看
bobpaddock
Senior Contributor III
0 项奖励
回复
2,316 次查看
johnstrohm
Contributor III

It appears that www.lvr.com has been hijacked or otherwise taken over by a retailer, www.luisaviaroma.com, which may or may not be legitimate.

0 项奖励
回复
2,316 次查看
bobpaddock
Senior Contributor III

lvr.com is now: http://janaxelson.com/

0 项奖励
回复
2,316 次查看
stevea
Contributor I

Thanks for this.  It looks useful, I'll give it a try.

I found a similar project in VB by J.Axelson at   http://www.lvr.com/serport.htm#example_code

The code uses the command SerialPort.GetPortNames to get the currently used ports (not necessarily open).

--steve

0 项奖励
回复
2,316 次查看
perlam_i_au
Senior Contributor I

I think as well as you  that CDC is the best USB class option for your project, but regard COM enumeration while connecting different devices I suggest you to check on specific documentation of USB.org - Approved Device Class Document Download, Enumeration of USB Composite Devices (Windows Drivers) and Enumeration of Interfaces on USB Composite Devices (Windows Drivers).

I hope you find this useful.

0 项奖励
回复