Solved

Communicating with ISA bus using C

Posted on 2000-03-23
2
415 Views
Last Modified: 2010-04-02
Hi guys,
I want to use C to communicate with an ISA card (dos prompt - command line).
How do I do it? What functions can I use in order to Read/Write to and from the card?
I need to write an HEX number to the card actually…
Please if you can paste a short (long) example to make life easier…

Tnx
      gschetrit
0
Comment
Question by:gschetrit
2 Comments
 
LVL 16

Expert Comment

by:imladris
ID: 2650035
There are a number of different ways that can occur, it depends on the card. One common mechanism for communication is through I/O ports. Many C compilers provide functions for this such as inp and outp. You will need the port number that the card uses. Writing would be something like:

outp(0x1f0,0x55);

That will write byte 0x55 (hex 55) to port 0x1f0 (hex 1f0).
0
 

Accepted Solution

by:
balakrishnan_t earned 50 total points
ID: 2666125
As our friend said , ISA devices are accessed using the IO ports configured to them. When an ISA device is configured, some IO ports are allocated to them. These IO ports for ISA devices are fixed(for pci devices io ports can be configured dynamically). For example for a keyboard, the ports are 60h and 64h.

 u can just use inp and outp to input or output bytes.... similarly u can use inpw and outpw.

here is the sample program.

#include "stdio.h"
#include "conio.h"
main()
{
 int i,j;
 clrscr();
 i=inp(0x80);
 printf("%d ",i);
 outp(0x80,22);
 i=inp(0x80);
 printf("%d",i);
 outp(0x80,44);
 getch();
 }
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Preface I don't like visual development tools that are supposed to write a program for me. Even if it is Xcode and I can use Interface Builder. Yes, it is a perfect tool and has helped me a lot, mainly, in the beginning, when my programs were small…
Summary: This tutorial covers some basics of pointer, pointer arithmetic and function pointer. What is a pointer: A pointer is a variable which holds an address. This address might be address of another variable/address of devices/address of fu…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

831 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question