USB HID Receive Data Error
wongfeirang from Malaysia  [26 posts]
9 year
Hi Steven.
I had try to implement USB HID on my RR application. However, I got an error on received data. I made a program that wait for RR USB HID to send '\50' to the microcontroller (PIC32) and then the microcontroller will send 50(Decimal) to RR. I had try using other USB HID tool (HID Terminal Tool) and the result was exactly what I expected on my program. However, when I try it on RR, the result was different. The received data was 141(Decimal) when I send \50 on console. I had change the microcontroller program for different sending data several time but the result still showed 141(Decimal). Any idea to solve this? See file attached for detail on USB HID received data.

wongfeirang from Malaysia  [26 posts] 9 year
Any response for this problem??
Steven Gentner from United States  [1446 posts] 9 year
We tested this out just to see what information is sent when using \50 but it works as expected and didn't find any issues in that area.

Could you include the code that you are using on the PIC so that we can setup a test case to replicate your issue?

When you type in something differen like \51 does the response number change? Just trying to understand if the 141 is even related to the 50 or if it is just printing out a number from some other part of the packet being sent.

The USB HID module uses the same routines that communicate to many other HID devices but, obviously, there is something different about this communication.

Also, just out of curiosity, are you using the HID interface as apposed to a Serial interface for a specific reason?

wongfeirang from Malaysia  [26 posts] 8 year
Hi Steven. Sorry for a very late reply. This is the answer for your previous question

I have included the source code for communicate between PIC32 and RR using USB for you to tested it. This code was written in MikroC Pro for PIC32.

I have try to type something that is not \50 and no response because the PIC32 will only send the 50 to RR if the RR sending 50 to PIC32. I had try to sending data from RR to PIC32 and it work as I can see the character appear on my LCD display. The problem now is when sending data from PIC32 to RR which RR unable to capture it and gave wrong character.

For your information, I just want to try communicate using USB HID for faster speed compare with serial as my application required high speed for best performance of my robot.

wongfeirang from Malaysia  [26 posts] 8 year
See attachment
wongfeirang from Malaysia  [26 posts] 8 year
See Attachment for Source Code
PIC32 to RR Communication.zip
Steven Gentner from United States  [1446 posts] 8 year
Thanks for the files. That always helps to understand the flow of information.

We found a potential problem that may be causing your issue. We have uploaded the fix to the latest version. Please download and give it a try.

*IF* you still find there is an issue you may need to read in two characters and just ignore the first one as in


. But only try this if you find just updating RR does not work.

wongfeirang from Malaysia  [26 posts] 8 year
Hi Steven. Thanks for the update.
I have try run my program using latest version of RR but unfortunately it still did not work.
I also alter the program to display the received data on RR whatever character I send to it. If I send 50 then RR will received 50 and so on. The result always display 62 regardless the character I sent to it. I have also try to use two variables for storing received data but the result was similar. Only one data has been received by RR which is 62.

Hope you have any idea to solve this problem.


Best Regards:
wongfeirang from Malaysia  [26 posts] 8 year
Any solution for this issue??
Steven Gentner from United States  [1446 posts] 8 year
Was just trying to test this out with a couple other HID devices. There was an issue that was corrected so it is once again worth a test. See if you get any different behavior this time after downloading the most recent version.

If that doesn't work, can you goto Options->Other tab and select the "Verbose RoboRealm.log" checkbox and then add back in the HID module and test. This will create a roborealm.log file either in c:\RoboRealm.log or on your Desktop or sometimes in the Win7 VirtualStore depending on your machine. This log file will contain some additional info that we can use to determine what might be going wrong.

You'll have to download the latest version for these updates.


This forum thread has been closed due to inactivity (more than 4 months) or number of replies (more than 50 messages). Please start a New Post and enter a new forum thread with the appropriate title.

 New Post   Forum Index