PORTS Forum
Ports and Interfaces => USB => Topic started by: webluca on April 12, 2012, 10:14:04 am
-
Hi,
everybody. This is my first topic on forum! ;)
I have problem with comunicationn between pc and a pic microcontroller.
I have tried the library (generic_hid_vb_50) but I can not send and read data simultaneously.
Is it possible to realize ?
I have to make an application that reads data from USB and sends the data that the programmer wants.
I always receive data from the PIC, then I have to sniff all data sent from the pic.
Is there someone that can help me?
Looking forward getting your reply soon
-
All of a device's data shares the bus, so send and receive technically can't be simultaneous.
My generic HID application sends data to the device, then reads a response.
But an application can attempt to read and write in any sequence.
Jan
-
The application works fine but I need a change.
I have divided the section to read the writing section.
I tried the version 5.0. The read operation waits for the reception of data.
I try to send data to the device and the application stops.
Can You send me a modified example.
I need help! ;-)
-
My application is a starting point that you can modify as needed.
If you want to write to the device without reading from it, comment out the code that reads from the device.
Jan
-
Hi
I modified the library.
Steps to follow to start form
1) Start the form
2) Click on find
3) Click on Continuos
4) click on send data
The form stops to point four, and not getting any response.
You can download modified solution:
http://dl.dropbox.com/u/47674327/generichid_vb_mod.rar
I need help! ;-)
-
up
-
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 if the device's endpoint is receiving and ACKing the data.
Jan
-
hi,
I checked your answer and the problem is not that.
I can send and receive data if i do the task in sequence.
I need to send data and read data asynchronously
I can receive 100, 2000, no packets asynchronously without sending anything!
I have to receive data without send something. The device has to "listen" always.
If you see above I pointed out the link from where you can download the modification to your library!
Please help me!
-
If you want the device to listen always, write your firmware to detect and retrieve received data using interrupts or polling. After retrieving data from the endpoint's buffer, the endpoint should be configured to ACK new data.
Jan
-
hi,
I must receive the data that the device sends me and not the other way!
The problem remains on application software!
;)
-
Modify the application so that after receiving data, it immediately attempts to read data again.
Jan
-
hi,
I have tried to modify the application but then I no longer send data forever!
You may check the files I changed?
-
In ExchangeInputAndOutputReports, comment out the code that sends a report. Exactly which line this is depends on the transfer type and whether you're using filestreams or writefile.
When GetInputReportData returns (transferInProgress = false), call ExchangeInputAndOutputReports again to begin another read operation.
Jan
-
I comment out the code that sends a report and then how do I send a report?
I have to use this function MyHid.SendOutputReportViaControlTransfer (hidHandle, outputReportBuffer)
or the other Me.fileWrite.Write (outputReportBuffer, 0, outputReportBuffer.Length) to send data?
I tried using the first or second and my application stops!!
IT STOPPS AND DOES NOT SEND DATA!!!!!
I stopped the application and it stops ON the Thread class?
You can send me a solution via email: webluca@aruba.it
Please help me because I can not complete my application because of this problem :o :o :o :o :o :o :o
I attach a photo:
(http://dl.dropbox.com/u/47674327/ScreenClip.png)
-
Get the read operation working first. Then you can add a button or other code to initiate writes to the device.
Jan