Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Communicating with ISA bus using C

Posted on 2000-03-23
2
Medium Priority
?
481 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

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…
This is a short and sweet, but (hopefully) to the point article. There seems to be some fundamental misunderstanding about the function prototype for the "main" function in C and C++, more specifically what type this function should return. I see so…
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.
The goal of this video is to provide viewers with basic examples to understand and use switch statements in the C programming language.

688 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