Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

How to use C++ to read/write data to an ISA/PCI card?

Status
Not open for further replies.

Sputnik

Full Member level 3
Joined
Oct 19, 2004
Messages
150
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Location
South Africa
Activity points
1,667
c++ write to pci

I've been wanting to do a project making use of a homemade PC expansion board installed into a computer so that I may interface the computer with the real world. I would like to use C++, pretty much because it is the only programming software I have. Either ISA or PCI as this will be used in a 486/Pentium 1.

Thanking you in advance
Sputnik
 

Regnum

Full Member level 5
Joined
Jun 17, 2004
Messages
262
Helped
18
Reputation
36
Reaction score
7
Trophy points
1,298
Location
Hurlingham
Activity points
2,168
Re: How to use C++ to write data to an ISA/PCI slot?

on which operating system?
 

Sputnik

Full Member level 3
Joined
Oct 19, 2004
Messages
150
Helped
4
Reputation
8
Reaction score
1
Trophy points
1,298
Location
South Africa
Activity points
1,667
Re: How to use C++ to write data to an ISA/PCI slot?

I will be using either Win95 or 98 but more likely 98.

Sputnik
 

sinatra

Full Member level 4
Joined
Mar 29, 2002
Messages
214
Helped
18
Reputation
36
Reaction score
7
Trophy points
1,298
Location
Neverland
Activity points
2,842
Re: How to use C++ to write data to an ISA/PCI slot?

You have 2 options.
1-Write a windows device driver;
2-Use inpout32 and access your hardware directly...

If you don't want to write a device driver go to:
https://www.logix4u.net/inpout32.htm

and download inpout32 this may help you a lot.
It should run in all windows flavours.
S.
 

Regnum

Full Member level 5
Joined
Jun 17, 2004
Messages
262
Helped
18
Reputation
36
Reaction score
7
Trophy points
1,298
Location
Hurlingham
Activity points
2,168
Re: How to use C++ to write data to an ISA/PCI slot?

Try the following functions only if you're using Win95/98
(they won't run on WinNT/2000/XP)
Regards

---------------------------------------------------------------
void WritePort(USHORT PortAddress, UCHAR PortData)
{
asm
{
mov dx,PortAddress
mov al,PortData
out dx,al
}
}
------------------------------------------------------
UCHAR ReadPort(USHORT PortAddress)
{
UCHAR PortData;
asm
{
mov dx,PortAddress
in al,dx
mov PortData,al
}
return PortData;
}
-------------------------------------------------------
 

    Sputnik

    Points: 2
    Helpful Answer Positive Rating

eltonjohn

Advanced Member level 4
Joined
Feb 22, 2002
Messages
1,435
Helped
64
Reputation
126
Reaction score
28
Trophy points
1,328
Activity points
16,326
Re: How to use C++ to write data to an ISA/PCI slot?

As was indicated to deal with big OS you need a driver .The user application request to the OS be granted the access then the OS looks for the driver to use . here is another possibility
https://www.jungo.com/ you can downloaded but it works for some time only ..then you have to buy it ..
 

Pinczakko

Full Member level 2
Joined
Jul 29, 2004
Messages
138
Helped
13
Reputation
26
Reaction score
0
Trophy points
1,296
Location
Taka Bonerate National Park, Indonesia
Activity points
1,592
if you want to do this stuff in win2K/XP, you can download my old "quick-hack" driver source code which can be downloaded at https://www.geocities.com/mamanzip/. The software named ExploChip, it's open source. Just look at portprobe.c (the driver source code) and in the user application code, the driver is accessed by the user application by using a call to DeviceIoControl API, that's available in windows. Goodluck :wink:
 

sinatra

Full Member level 4
Joined
Mar 29, 2002
Messages
214
Helped
18
Reputation
36
Reaction score
7
Trophy points
1,298
Location
Neverland
Activity points
2,842
Please look at my previous post.
You don't have to worry. inpout32 works in all flavours of windows, w95/98, nt, 2k, xp, etc....
Have a look at:
h**p://www.logix4u.net/inpout32.htm
You don't have to pay anything, and the source code is available!
S.
 

aamiralikhoja

Member level 5
Joined
Aug 11, 2004
Messages
90
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
708
Hello dear
u can also use tvichw32 which have the following link

www.entechtaiwan.com/dev/index.shtm

this is the o.s indepndent this is shareware and very easy to use .

u can also write interrupt routines easily in any language.

it contains bundle of examples in very common languages.
 

sztibi82

Full Member level 3
Joined
Aug 31, 2004
Messages
155
Helped
8
Reputation
16
Reaction score
4
Trophy points
1,298
Activity points
1,120
Hi.
I use a PCL data aquisition card for ISA. I simply read and write from/to it using outportb in C++.
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top