This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

usb hid

Thanks in Advance
I am using keil HID example to make a usb hid device for sending data using interrupt transfer. My device is able to send data to pc .i am able to check data that i sent to PC using device monitor studio but when i try to read data on my own made usb host application it shows timeout error . My host application is also able to send data to my device that can also be check on same software device monitor studio .but when i check in my software there is no interrupt on endpoint 1.
can anybody help me in that case

  • Really not enough information to give a good reply. Are you sending a full packet? That is if you have defined a packet as 64 bytes(the default) in your descriptor file but you are sending less than 64 bytes the HID driver in the PC waits for additional data until time out. If you send less than a full packet you must send a Zero Length Packet to tell the HID driver that the short data packet is complete. Search on ZLP in this forum and at http://www.lvr.com.
    Bradford

  • Thanks Bradford

    I am sending fixed size packet of 64 bytes and it is completely recieved by device monitor studio.but when i try to read through host application made by me using ivr.com example it shows 258 timeout error.but when i remove the report id in hid report descriptor it is successfuly received by my host application without any timeout error. can you explain me the concept of report id .Also I want to send packet size of different length ranging from 0-64k
    how it is possible or by what changes in HID report descriptor.

  • You can't send any 64k packets - but you can configure and send one or more 64-byte packets where the final packet either isn't fully filled or where you send a zero length packet, just to inform the receiving end that it has received a complete block and do not need to wait for more 64-byte packets to combine.

    But Google is your friend. This forum has probably 100 threads covering this exact problem if you just use the search function.

  • As Per points out, you can send multiple packets to make up 64KBytes but the max single packet transaction is 64 bytes. On the HID side you must specify the report size PLUS 1 byte for the Report ID. If you do not use the report ID you just send the packets.

    Search on this forum in the upper right corner for Report ID. Tsuneo Chinzei has answered this question a number of times on this forum such as http://www.keil.com/forum/docs/thread12207.asp

    Bradford