Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

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
 
So the answer is "no solution" :(

That was pretty much the drift I came away with. This is far from my forte but there has to be a doable work around.

Ron
 
The workaround seems to be to use polling. Damn, I was hoping it wouldn't come to that.
 
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:
Do you mean a thread to do the polling? What about using my mouse port, as above?
 
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:
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.

New Articles From Microcontroller Tips

Back
Top