PORTS Forum
Ports and Interfaces => USB => Topic started by: eoin on April 12, 2011, 06:49:57 am
-
Hi there all,
I am successfully using the WinUsb example to communicate with my PIC24F using BULK. On the PIC side I receive USB data from the PC interrupt driven, but on the PC I always have to ask the PIC for data. How could I make this WinUsb code interrupt driven on the PC, ideally whenever a packet is received from the PIC I want it to jump into an event handler in my PC application.
Any ideas will be much appreciated.
EOin
-
In your application, create a thread that checks for new data and interrupt the main thread when data is available.
Jan
-
Ok I think I can get the piece working with the thread, but which function do i need to poll in this new Thread to check for USB data?
-
In my WinUSB example, see ReadDataViaInterruptTransfer. After receiving data, call it again.
Jan