Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Communicating with ISA bus using C

Posted on 2000-03-23
2
Medium Priority
?
488 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 150 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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…
Windows programmers of the C/C++ variety, how many of you realise that since Window 9x Microsoft has been lying to you about what constitutes Unicode (http://en.wikipedia.org/wiki/Unicode)? They will have you believe that Unicode requires you to use…
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 for-loops in the C programming language.
Suggested Courses

783 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