Solved

Communicating with ISA bus using C

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

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

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

An Outlet in Cocoa is a persistent reference to a GUI control; it connects a property (a variable) to a control.  For example, it is common to create an Outlet for the text field GUI control and change the text that appears in this field via that Ou…
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…
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.
The goal of this video is to provide viewers with basic examples to understand opening and reading files in the C programming language.

829 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