Author Topic: How to read Continuous data Using WinUSB ?  (Read 15657 times)

rfkfun

  • Member
  • ***
  • Posts: 1
How to read Continuous data Using WinUSB ?
« on: September 06, 2010, 01:38:21 am »
I am working with PIC18F4550 and WinUSB protocol.

Earlier I Implemented USB CDC Class. Host end software made using VB6.0. When controller sends data MSComm1.CommEvent handles the data and print the data to a file.

In WinUSB I am not able to understand how can i generate event on data arrival in USB port.

Send a command through WinUsb_WritePipe()->Controller side starts timer0->Controller sends data in every 1 ms->Host side software should have capability to get every packet of data. Means WinUsb_ReadPipe() function  will automatically call when controller sends the data. How do I implement this?

Please Help me.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: How to read Continuous data Using WinUSB ?
« Reply #1 on: September 06, 2010, 11:53:37 am »
Create a thread that calls WinUsb_ReadPipe continuously and notifies the main thread when data is available. Each call adds overhead so no guarantee that the host can call the function every millisecond. I have WinUSB example code here:

http://www.lvr.com/winusb.htm

Jan