Interrupt Programming in Visual C++

Status
Not open for further replies.

BrownOut

Banned
I'm developing a parallel port interface for my FPGA development system. I have a basic parallel program running that uses a kernal level driver for the input/output. Now, I want to modify the system to use the interrupt facility on the port. I have seen code developed from Borland that calls the functions "getvect" and "setvect" for modifying the interrput vectors for the port, but I don't think those libraries are included in my Visual Studio 2005 package. Does anyone know how to solve this? or know of a comparable library call included in Visual Studio? Thanks!

Oh, and BTW, I've already tried Google. Haven't come us with anything simple yet.
 
Last edited:
**broken link removed** a little. Read down the page where he mentions Visual Studio and C++.

Ron
 
Windows pretty much isolates you from hardware interrupts. Win9x you could still do it, but not on the newer systems.
 
I had a crazy idea.... could I use the mouse port as as way to pass a message to my comm program, using the "on_click()" visual control??? That might be a good way to advoid polling. Whadda think?
 
Last edited:
So it does poll? Polling is OK, I want to try to avoid it, but I'll do it if I don't come up with a better idea.
 
Last edited:
Most pcs now are multi core so polling in another thread wont slow down your main thread.
Some Intel cpus even multi thread in the same core.
 
Hi BrownOut,

I have done some Windows C++ programming, more so on UNIX. However, I have used lots of libraries and classes that are provided by Microsoft. I did a little searching on the MSDN site and there are some articles here: Parallel port interrupts - MSDN Search

I would bet that you don't need a hardware interrupt to use the parallel port. There will be lots of access to the drivers through the various API calls.

The mechanism by which you read the port will be up to you: You can wait for events that data is ready; you can do polling and set short timeouts; lots of ways to get the data. A separate thread is a very good choice too -- especially if your application has a user interface.

I hope this helps!

Sincerely,

Kooth
 
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…