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.

how to access parallel port in c++

Status
Not open for further replies.

001

Junior Member level 3
Junior Member level 3
Joined
Aug 31, 2004
Messages
30
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
288
+linux direct access parallel port as user

Hello

can someone tell me how to access the parallel port in c++ using linux operating system. I had some codes I used , it sent and was able to read data at the data register. but unfortunately when i connected some leds to the parallel port, i noticed that the was no effect on the ports, because the leds did not change.please can someone help.

001
 

how to access com port c++

hea

under linux u can easily wirte a small parallel port module and plug it to the kernel and access the module form ur program ...

pls read the linux device driver 2 ed book it has a parallel port driver section which will be useful for u...

this book is free pdf and available @ linux.org just search
 

accessing parallel port in c

You can access the io ports if you run the program with root privilidges.
A kernel module is more elegant but more work.
 

hi all,

writing a program in C++ to run on LINUX actually needs a compiler....
do you know any free C++ compiler for LINUX??
 

elecomm said:
hi all,

writing a program in C++ to run on LINUX actually needs a compiler....
do you know any free C++ compiler for LINUX??

Ehhh ??

What about GCC (g++) , it is the one most Linux modules are build with

/Bingo
 

Hello,

You can access the io ports if you run the program with root privilidges.


I actually used 'root' to login thats whats even making me more confused. I dont know if there is something like a parallel port driver i have to install before it works. I experienced a similar thing once on windows. A program that was able to access the parallel port in win 98, and changed the LED display was unable to do same in win XP. I really need help.


001
 

Hi,

Maybe some info here :

h**p://www.epanorama.net/circuits/parallel_output.html

h**p://www.logix4u.net/inpout32.htm

Replace * by t
 

I am doing remote temperature data collecting system which about 400km away from my office. But it's a visual basic programs which use parallel port to acquire the temperature data. My program has been integrated with a trial activex control from www.geocities.com/bagtool/adc_activex.html

I think this adc activex control provides a good result. I hope it will help.


:D heino
 

under winNT and above direct access is forbidden. you will have to use application available to bypass this OS feature
 

Windows above 98 or linux there is no control of the ports for user. In kernel mode it is available.

In NT/2K/XP we have to use "inpout32.dll" or "io.dll" which can be downloaded from internet.

In linux, you must log in as "root", and in the C program you need to do the follwing.

1) include <asm/io.h>
2) you have to use the option with −O1 or higher, I have tried -O2 and it worked
3) before accessing the ports, you must seek the permissions for the ports with which you want to access.
This is done with "ioperm" function call.
for parport ioperm(0x378, 3, 1)
4) Then only you will get true access to the ports.

please reffer to the "Linux I/O port programming mini−HOWTO" with the link
https://www.ibiblio.org/pub/Linux/docs/HOWTO/other-formats/pdf/IO-Port-Programming.pdf


Vedas
 

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top