Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Parallel Port Programming.

Status
Not open for further replies.

Lord Loh.

Full Member level 4
Joined
Jun 19, 2004
Messages
196
Helped
1
Reputation
2
Reaction score
0
Trophy points
1,296
Location
Texas
Activity points
1,951
Hi,

Below is a Turbo C code for parallel port testing....

Code:
#include<stdio.h>
#include <conio.h>
#include <dos.h>

int main(void)
{
	int far *LPT1=(int far*)0x408;
	int portID=*LPT1;
	short int inData, outData;
	clrscr();
	printf("LPT1 Address is at %X\n",portID);
	while(!kbhit())
	{
		inData=inportb(portID);
		printf("Read :%X\n",inData);
		outData=inData^0xFF;
		outportb(portID,outData);
		printf("Write :%X\n",outData);
		delay(1000);
	}
	return 0;
}

When I test this code on machines with WindowsXP, I see an output like
Code:
Read : AA
Write: 55
Read: AA
Write: 55

However, when I run this code on win98 systems,
Code:
Read : AA
Write: 55
Read: 55
Write: AA

What could be the reason? I have not tested this on any other OS. How can I get over this problem.
 

you are using the parrallel port with the address port of win98 because win98 give you the rights to access machine ports but you are restricted in winXP you have to use some kind of driver to access the port or you may learn the socket programming to use it in easy manner.
ok.
 

I have to complete an parallel port interfacing project in C. My college computers run Windows 98. However, all my friends are using XP. I myself do not have access to a PC so have to go to my friend's place for the PC. and those programmes that run perfectly well in the college, give a hell lot of torubles at home.

I cannot use anything other than TC. It is a course requirement.

Any way out?
 

As WinXP kernal has not user to direct access to port ,you may be using DLL from
"I/O Port DLL File " of www.lvr.com
Which has Ex. code and DLL file can use on All Windowns version
 

This is because there is some security for parallel ports in all the windows version after Windows ME. IF you want to get parallel port acess in higher versions of windows instal userport. The link below will tell you how to do it
**broken link removed**

Bibin John
www.bibinjohn.tk
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top