Ports and Interfaces > USB

WinUsb example, how to make Interupt driven?

(1/1)

eoin:
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

Jan Axelson:
In your application, create a thread that checks for new data and interrupt the main thread when data is available.

Jan

eoin:
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?

Jan Axelson:
In my WinUSB example, see ReadDataViaInterruptTransfer. After receiving data, call it again.

Jan

Navigation

[0] Message Index

Go to full version