K20 USB low-level communication

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

K20 USB low-level communication

Jump to solution
1,090 Views
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

Labels (2)
Tags (2)
0 Kudos
1 Solution
736 Views
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.

View solution in original post

0 Kudos
7 Replies
737 Views
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 Kudos
736 Views
Teckna
Contributor V

Hi Bob,

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

Many thanks

Teckna

0 Kudos
736 Views
bobpaddock
Senior Contributor III
0 Kudos
736 Views
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 Kudos
736 Views
bobpaddock
Senior Contributor III

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

0 Kudos
736 Views
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 Kudos
736 Views
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 Kudos