Solved

Communicating with ISA bus using C

Posted on 2000-03-23
2
398 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Have you thought about creating an iPhone application (app), but didn't even know where to get started? Here's how: ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ Important pre-programming comments: I’ve never tri…
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…
The goal of this video is to provide viewers with basic examples to understand recursion in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use nested-loops in the C programming language.

861 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

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now