USB communication between two Microcontroller

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

USB communication between two Microcontroller

1,942 Views
karthikas
Contributor IV

We are using MK66 MCU in our application, Here in our scenario we have two MK66 MCU communicating via USB.

Now I need to develop driver for both host and device mode, To start with I have decided to use SDK2.0 example which are available. 

>> I need suggestions from your side about which class I need to prefer & which example should I use and so on. give me some base picture to implement this requirement.

>> Here I am thinking use simple bulk transfer with 2 endpoints (Bulk IN & Bulk OUT).

Labels (2)
0 Kudos
2 Replies

1,359 Views
mjbcswitzerland
Specialist V

Karthik

Probably the most logical method is to use USB-CDC host and device so that the application sees the connection as a VCOM port - effectively as if it were a UART (COM port) connection.

This is how it is done in the uTasker project - if I find time later I'll post you a video of it operating with the FRDM-K66F.

It is also possible to use composite CDC to have up to 6 such connections between the two devices. This can be interesting if communication is divided into "pipes" - eg. a data channel and some control channels, or such channels between different software modules at both ends. The CDC interfaces make each pipe act like a unique VCOM connection between two ends which means that each has a virtual direct communication path without any need for additional multiplexing, parsing etc. to recognise/route which are the source and destination of each transfer.

You didn't mention whether you will be using USB0 or USB1 in the K66 since they are different controllers and need different software solutions.

I don't know about what SDK2.0 can and cannot do but this is the technique that is most logical (one IN and one OUT bulk for each virtual connection, whereby IN/OUT can also share a single endpoint to increase the capabilities of the controllers).

Regards

Mark

http://www.utasker.com/kinetis.html

0 Kudos

1,359 Views
mjbcswitzerland
Specialist V

Karthik

I have shown USB-CDC operation for communication between a K64 and K66 here
https://youtu.be/XhISV1czIo4

Regards

Mark

0 Kudos