How to communicate via USB with Windows 7 device using Kinetis K20?

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

How to communicate via USB with Windows 7 device using Kinetis K20?

跳至解决方案
1,675 次查看
hardeepsingh
Contributor II

I would like to connect a tablet running on windows 7 with my own card which is built around Kinetis K20. Please suggest how should I interface both using USB.

Will my K20 support communication with a Windows 7 device?

标签 (2)
标记 (3)
1 解答
1,027 次查看
dspNeil
Contributor III

Yes, this can be done, and is quite common. You really need to define how you need to interface (what USB class). You will need to operate the K20 device as a USB Device, not a USB Host, as the Win7 device will be the Host.

Have a look at the baremetal USB stack examples; there are many good examples that might do just what you need. Install the stack, and look through the documentation/examples: USB Stack Product Summary Page

Alternatively, you could use MQX if you desire an RTOS. There are many examples for this as well. Install MQX, and look through the documentation/examples: http://www.freescale.com/mqx

在原帖中查看解决方案

4 回复数
1,027 次查看
Hui_Ma
NXP TechSupport
NXP TechSupport

Hi,

MK20 50MHz product provides USB Full speed controller, which can communication with PC (Windows 7 OS).

Freescale provides USB stack, the latest version is V4.1.1.

Customer can download it from below link:

http://www.freescale.com/webapp/sps/site/prod_summary.jsp?code=MEDICALUSB&fpsp=1&tab=Design_Tools_Ta...

After programed, MK20 can works as USB device, such HID mouse or CDC device communication with PC.

Wish it helps.

1,027 次查看
Wayner
Contributor II

Hello,

I have problems with USB device application on MK20 board, could you tell me how

to port the application code from MK40 which exists in USB Stack v4.1.1 to MK20?

What I have done is as follows, but it doesn't work.

Host USB: PC with Windows 7 OS

Slave USB: MK20

IDE: IAR Embedded Workbench for ARM V6.60.1.5104

Based Project: Freescale USB Stack v4.1.1/Source/Device/app_composite/msd_and_cdc/jar_ew/kinetis_40/USB_MSD_CDC.ewp

I changed very little from based projected for my board, which is:

1. Changed Processor variant setting to MK20DN512Zxxx10 which is used on my board in General Options of IAR.

2. Changed #include <MK40N512VMD100.h> to #include <MK20N512VMD100.h> in derivative.h file

3. Removed GPIO_Init().

4. Removed #ifdef MCU_MK40N512VMD100 pair in pll_init() function in main_kinetis.c

5. Modified #if (defined MCU_MK40N512VMD100) || (defined MCU_MK53N512CMD100) || (defined MCU_MK60N512VMD100) || (defined MCU_MK70F12)

  to  #if (defined MCU_MK40N512VMD100) || (defined MCU_MK53N512CMD100) || (defined MCU_MK60N512VMD100) || (defined MCU_MK70F12)

        || (defined MCU_MK20N512VMD100) in usb_devapi.h file

6. kept the same Linker configuration file, which is MK40N512VMD100_Flash.icf

What else needed to do?

Need your help. Thank you!

0 项奖励
回复
1,027 次查看
Wayner
Contributor II

Solved. It was a hardware problem. Thank you!

0 项奖励
回复
1,028 次查看
dspNeil
Contributor III

Yes, this can be done, and is quite common. You really need to define how you need to interface (what USB class). You will need to operate the K20 device as a USB Device, not a USB Host, as the Win7 device will be the Host.

Have a look at the baremetal USB stack examples; there are many good examples that might do just what you need. Install the stack, and look through the documentation/examples: USB Stack Product Summary Page

Alternatively, you could use MQX if you desire an RTOS. There are many examples for this as well. Install MQX, and look through the documentation/examples: http://www.freescale.com/mqx