Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > USB Controllers > C# HID Communication

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



C# HID Communication
Moderator:
RSKV

Post Reply
Follow this topic



C# HID Communication

monkeyking posted on 23 Sep 2011 12:21 PM PST
Member
9 Forum Posts

Hi,

I'm developing a temperature controller which need to communicate with PC. I want to use HID so I don't need to develop the usb driver. But when I finished a demo firmware. The device can send data to EP1, but the PC applicaiton can not receive the IN data. Also when the PC app send data to EP2, the controller can not receive the OUT data. I captured the data by Bushound, and found the PC and the device are always communicated by EP0. My question is how can I read the data from EP1 and write data to EP2 with the HID device.

Attached is the report descriptor I am using.

 




Re: C# HID Communication

aasi posted on 24 Sep 2011 11:51 PM PST
Cypress Employee
1090 Forum Posts

What is the host application that you're using to communicate with EP1 and EP2 based on?

Regards,

Anand



Re: C# HID Communication

monkeyking posted on 26 Sep 2011 05:37 AM PST
Member
9 Forum Posts

I am developing a host application by myself using C#. The purpose of the host application is to establish the communication between the PC and Embedded board, so that I can send some command by usb to the embedded board. For example, if I want to let the temperature to 15degree, I would use the host application to send a command to the device. When the device received the command, it will do the exactly thing.

Regards



Re: C# HID Communication

aasi posted on 26 Sep 2011 10:12 AM PST
Cypress Employee
1090 Forum Posts

What I'm asking is the HID device would be connected to HID driver usbhid.sys. What are you using to communicate with this driver so that you can send the requests to the HID device.

Regards,

Anand



Re: C# HID Communication

monkeyking posted on 26 Sep 2011 01:25 PM PST
Member
9 Forum Posts

I'm using the CyUSB.dll which is downloaded from cypress.com to communicate with the driver. The class I am using is CyHidDevice.



Re: C# HID Communication

aasi posted on 28 Sep 2011 02:34 AM PST
Cypress Employee
1090 Forum Posts

Using ReadInput( )/WriteOutput( ) you should be able to communicate with the non-Control endpoint. Are you using this or are you using GetInput( )/SetOutput( )?

Regards,

Anand



Re: C# HID Communication

monkeyking posted on 04 Oct 2011 01:20 PM PST
Member
9 Forum Posts

Hi Anand,

 

I used ReadInput( )/WriteOutput( ), but all the data I read are 0. For example, I let the PSoC 3 send three bytes data 01 03 07, I can see these data were write to endpoint 1 on Bushound. But on the PC side, I can only read 0. And I watched the Inputs.DataBuf, all the data are 0.

 

Thank you



Re: C# HID Communication

aasi posted on 04 Oct 2011 09:33 PM PST
Cypress Employee
1090 Forum Posts

Please check if you're sending the variables right. If possible please attach your host app here I would like to take a look at it.

Regards,

Anand



Re: C# HID Communication

monkeyking posted on 05 Oct 2011 05:39 AM PST
Member
9 Forum Posts

Hi Anand,

The Host App is very simple.

 

USBDeviceList HidDevices = new USBDeviceList(CyConst

.DEVICES_HID);

 

CyHidDevice hidDev = HidDevices[0x04B4, 0x8051] as CyHidDevice;byte[] rcv = hidDev.Inputs.DataBuf;

When I set break point after the last line. I can see the information of the hidDev. But the datas in DataBuf are all 0.Attached are the PSoC code and the Bushound information.

Thank you

hidDev.ReadInput();

 



Re: C# HID Communication

monkeyking posted on 05 Oct 2011 05:41 AM PST
Member
9 Forum Posts

Hi Anand, 

The Host App is very simple.

USBDeviceList HidDevices = new USBDeviceList(CyConst.DEVICES_HID);

CyHidDevice hidDev = HidDevices[0x04B4, 0x8051] as CyHidDevice;

byte[] rcv = hidDev.Inputs.DataBuf;

hidDev.ReadInput();

When I set break point after the last line. I can see the information of the hidDev. But the datas in DataBuf are all 0.Attached are the PSoC code and the Bushound information.

Thank you

 

 



 



Re: C# HID Communication

Alby posted on 18 Jul 2012 01:06 PM PST

1 Forum Post

 

 

WHERE IS

\GUI\ Interrupt_Transfer_Example \bin\Release.

I WOULD LIKE TO USE THIS PGM TO SEE IF MY USB IN THE PSOC WORKS

THIS IS IN YOUR PDF FILE

USB Interrupt Transfer Example
– PSoC® 3 / PSoC 5

 

 



Re: C# HID Communication

RSKV posted on 19 Jul 2012 07:43 AM PST
Cypress Employee
848 Forum Posts

Alby,

I did not get your question clearly. Could you please add few more details to it.

Thanks,

sai krishna.



Re: C# HID Communication

aasi posted on 24 Jul 2012 07:20 AM PST
Cypress Employee
1090 Forum Posts

 The .rar file that comes as part of http://www.cypress.com/?id=4&rID=58480 should have it.






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: KXP; Secondary Owner: VWA; Sunset Date: 01/01/20