Ports
May 20, 2013, 10:19:55 pm
Welcome,
Guest
. Please
login
or
register
.
1 Hour
1 Day
1 Week
1 Month
Forever
Login with username, password and session length
News
: SMF - Just Installed!
Home
Help
Search
Login
Register
Welcome to the PORTS Forum. Please post your questions, answers, and comments relating to USB and other hardware interfaces in the appropriate forums below. - Jan
Ports
>
General Category
>
USB
>
WinUsb example, how to make Interupt driven?
Pages: [
1
]
« previous
next »
Print
Author
Topic: WinUsb example, how to make Interupt driven? (Read 2687 times)
eoin
Member
Posts: 5
WinUsb example, how to make Interupt driven?
«
on:
April 12, 2011, 05: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
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1626
Re: WinUsb example, how to make Interupt driven?
«
Reply #1 on:
April 12, 2011, 09:35:18 am »
In your application, create a thread that checks for new data and interrupt the main thread when data is available.
Jan
Logged
eoin
Member
Posts: 5
Re: WinUsb example, how to make Interupt driven?
«
Reply #2 on:
April 13, 2011, 05:26:10 am »
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?
Logged
Jan Axelson
Administrator
Frequent Contributor
Posts: 1626
Re: WinUsb example, how to make Interupt driven?
«
Reply #3 on:
April 13, 2011, 08:21:24 am »
In my WinUSB example, see ReadDataViaInterruptTransfer. After receiving data, call it again.
Jan
Logged
Pages: [
1
]
Print
« previous
next »
Jump to:
Please select a destination:
-----------------------------
General Category
-----------------------------
=> USB
=> Serial Ports
=> Embedded Ethernet
=> Parallel Port
=> Other Interfaces
=> General Discussion
Loading...