PORTS Forum
Ports and Interfaces => USB => Topic started by: lcpoon on April 16, 2012, 04:26:05 am
-
I send a command to the uC 3 times and used SysNucleus USBTrace to monitor the USB activities. The uC consistently returns "Rev: A (16th April 2012)".
Using WinUSB VB codes, I found out that the return message contains rubbish data concatenated with the desired data. The problem is that the rubbish data keeps changing. How to solve this?
-
The problem only occurs in Window 7. I have the program running in Windows XP and no problem at all (no rubbish data concatenated with the desired data).
-
See attached file for more details.
[attachment deleted by admin]
-
A hardware protocol analyzer will show what is happening on the bus. If you don't have an analyzer, use a monitor program, watch variables, etc., or whatever debugging tools you have to find out what the device is sending.
Jan
-
Actually I am using USB Trace to log all the USB events as attached. The device is sending "Rev: A (16th April 2012). It is the VB program that gives incorrect output.
-
In the call to
deleg.EndInvoke(receivedDataBuffer, bytesRead, success, ar)
bytesRead is the number of bytes read. Anything after that is whatever was in the application's buffer.
Jan
-
It works. I make use of bytesRead information to get rid of unwanted data. Thanks.
-
Glad you got it working. I'll try to remember to fix that on the next update.
Jan