473,287 Members | 1,582 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,287 software developers and data experts.

Parallel port programming

I would like to know how one can use the parallel port through
c/c++.Also, how does one determine what port is
installed(EPP/ECP/SSP/PS2)?
What is the differnece between these?
What are the current sinking/drawing capacities of these ports?
If possible, please give examples in C/C++.
Thanks

I would be grateful if any ebooks/tutorials could be provided at
ka*************@yahoo.com
Nov 14 '05 #1
11 3289
karan <ka***@iitk.ac.in> scribbled the following:
I would like to know how one can use the parallel port through
c/c++.Also, how does one determine what port is
installed(EPP/ECP/SSP/PS2)?
What is the differnece between these?
What are the current sinking/drawing capacities of these ports?
If possible, please give examples in C/C++.
Thanks


Neither C or C++ defines parallel ports, or any other hardware for that
matter. Please ask in a newsgroup dedicated to your own operating
system.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"When a man talks dirty to a woman, that's sexual harassment. When a woman talks
dirty to a man, that's 14.99 per minute + local telephone charges!"
- Ruben Stiller
Nov 14 '05 #2
I guess you were in a hurry that you misinterpreted my post.
I would like to know how one can use the parallel port through c/c++.

- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.

Hope this clarifies and please read the message completely.

Joona I Palaste <pa*****@cc.helsinki.fi> wrote in message news:<cl**********@oravannahka.helsinki.fi>... karan <ka***@iitk.ac.in> scribbled the following:
I would like to know how one can use the parallel port through
c/c++.Also, how does one determine what port is
installed(EPP/ECP/SSP/PS2)?
What is the differnece between these?
What are the current sinking/drawing capacities of these ports?
If possible, please give examples in C/C++.
Thanks


Neither C or C++ defines parallel ports, or any other hardware for that
matter. Please ask in a newsgroup dedicated to your own operating
system.

Nov 14 '05 #3
karan <ka***@iitk.ac.in> scribbled the following:
I guess you were in a hurry that you misinterpreted my post.
> I would like to know how one can use the parallel port through c/c++.
- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port. Hope this clarifies and please read the message completely.


I understand you want to write C code to use the parallel port, but the
fact remains, it's impossible to write such code in standard C, and
standard C is the only thing this newsgroup discusses. I didn't make
this rule, it's been here years before I came here. If you don't believe
me, ask the other regulars.

--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ------------- Finland --------\
\-------------------------------------------------------- rules! --------/
"You will be given the plague."
- Montgomery Burns
Nov 14 '05 #4
In article <54**************************@posting.google.com >,
karan <ka***@iitk.ac.in> wrote:
- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.


It might be something like:

fd = open("/dev/parallel", O_RDWR);

followed by ioctl()s and read()s and write()s.

Or, perhaps it might be something like:

volatile unsigned char *pport_data = (volatile unsigned char *)0xf00c3158;
volatile unsigned char *pport_ctl = (volatile unsigned char *)0x14;

followed by direct access to *pport_ctl and *pport_data.

Then again, it might be something like:

#define PPORT_CTL 0771410
#define PPORT_DATA 0771412
...
outb(PPORT_CTL, control_value);
data = inb(PPORT_DATA);

perhaps preceded by some operation to grant access to those ports.

It could be something different from all of these. The correct
answer depends on your platform.

*Because* the answer depends on your platform, you need to ask
elsewhere, such as in a newsgroup dedicated to your platform.

There may not be such a place -- in which case, you may be completely
stuck; or perhaps comp.arch.embedded might be helpful.
--
In-Real-Life: Chris Torek, Wind River Systems
Salt Lake City, UT, USA (40°39.22'N, 111°50.29'W) +1 801 277 2603
email: forget about it http://web.torek.net/torek/index.html
Reading email is like searching for food in the garbage, thanks to spammers.
Nov 14 '05 #5
On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , ka***@iitk.ac.in (karan)
wrote:
I guess you were in a hurry that you misinterpreted my post.
> I would like to know how one can use the parallel port through c/c++.


- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.


Thats well understood. Joona's point is that this group discusses the C
Language, and the language doesn't define parallel ports which are hardware
devices managed by your OS. As you have already been told, please ask in a
group specialising in your operating system and possibly your compiler.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #6
On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , ka***@iitk.ac.in (karan)
wrote:
I guess you were in a hurry that you misinterpreted my post.
> I would like to know how one can use the parallel port through c/c++.


- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.


Thats well understood. Joona's point is that this group discusses the C
Language, and the language doesn't define parallel ports which are hardware
devices managed by your OS. As you have already been told, please ask in a
group specialising in your operating system and possibly your compiler.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #7
On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , ka***@iitk.ac.in (karan)
wrote:
I guess you were in a hurry that you misinterpreted my post.
> I would like to know how one can use the parallel port through c/c++.


- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.


Thats well understood. Joona's point is that this group discusses the C
Language, and the language doesn't define parallel ports which are hardware
devices managed by your OS. As you have already been told, please ask in a
group specialising in your operating system and possibly your compiler.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #8
On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , ka***@iitk.ac.in (karan)
wrote:
I guess you were in a hurry that you misinterpreted my post.
> I would like to know how one can use the parallel port through c/c++.


- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.


Thats well understood. Joona's point is that this group discusses the C
Language, and the language doesn't define parallel ports which are hardware
devices managed by your OS. As you have already been told, please ask in a
group specialising in your operating system and possibly your compiler.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #9
On 18 Oct 2004 10:25:51 -0700, ka***@iitk.ac.in (karan) wrote in
comp.lang.c:
I guess you were in a hurry that you misinterpreted my post.
I would like to know how one can use the parallel port through c/c++.


- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.

Hope this clarifies and please read the message completely.


Don't top post.

All right, let's see if I remember...

unsigned char *parallel_port = (unsigned char *)0x3ff8;

Then just write to *parallel_port.

I could have the address wrong. It's a long time since I programmed
the parallel port on a TRS-80 Model 1.

Buy heck, it's C.

--
Jack Klein
Home: http://JK-Technology.Com
FAQs for
comp.lang.c http://www.eskimo.com/~scs/C-faq/top.html
comp.lang.c++ http://www.parashift.com/c++-faq-lite/
alt.comp.lang.learn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #10
Jack Klein wrote:

On 18 Oct 2004 10:25:51 -0700, ka***@iitk.ac.in (karan) wrote in
comp.lang.c:
- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.

Hope this clarifies and please read the message completely.


Don't top post.

All right, let's see if I remember...

unsigned char *parallel_port = (unsigned char *)0x3ff8;


I think that should be my_parallel_port.
Then just write to *parallel_port.

I could have the address wrong. It's a long time since I programmed
the parallel port on a TRS-80 Model 1.


--
pete
Nov 14 '05 #11
On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , ka***@iitk.ac.in (karan)
wrote:
I guess you were in a hurry that you misinterpreted my post.
> I would like to know how one can use the parallel port through c/c++.


- I simply want some code in C(and this is the C Newsgroup) to
write/read my parallel port.


Thats well understood. Joona's point is that this group discusses the C
Language, and the language doesn't define parallel ports which are hardware
devices managed by your OS. As you have already been told, please ask in a
group specialising in your operating system and possibly your compiler.
--
Mark McIntyre
CLC FAQ <http://www.eskimo.com/~scs/C-faq/top.html>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
----== Posted via Newsfeed.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeed.com The #1 Newsgroup Service in the World! >100,000 Newsgroups
---= 19 East/West-Coast Specialized Servers - Total Privacy via Encryption =---
Nov 14 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Yuancai \(Charlie\) Ye | last post by:
Hi, All: I am happy to annouce that we have formally released our latest SocketPro version 4 at www.udaparts.com, an advanced remoting framework written from batching/queue, asynchrony and...
6
by: Novice Experl | last post by:
I'd like to write a simple application that interfaces with the parallel port, and changes the data on it according to keyboard input. I hope I can get it to run under windows xp and / or windows...
9
by: MNQ | last post by:
Hi All I want to use my parallel port of my PC to control some external devices. I am writing a program in ANSI C using the PacificC compiler. What I need to know is how to access the parallel...
11
by: Isaac T Alston | last post by:
Basically, I'm thinking about building a robot which can be controlled by programs which I write, I'm going to interface to the robot through the parallel port (like in this tutorial here:...
11
by: Timothy Smith | last post by:
hello people. i've been trying to send an 8 byte string to my parallel port under freebsd. the purpose is it to control a relay board. the board simply responds to the output byte coming from...
1
by: rajat varshney | last post by:
I am doing a project on controlling a stepper motor through computer parallel port over a network. I have also done parallel port programming in C but I need some help on how to send output on...
6
by: abhi | last post by:
Hello, I want to create a small project which will display scrolling text on LED that will be attached to Parallel port. I want to create this project in C language(possibly in Mingw) on Windows...
2
by: pete_tomson | last post by:
Hi - I'm trying to read data from my parallel port. Does anyone know how I can write a program in vb6 to read pin 6 of my parallel port. All I need to know is whether there is an incoming signal -...
4
by: Soren | last post by:
Hi, I want to control some motors using the parallel port.. however, my laptop does not have any parallel ports (very few do). What I do have is a USB->Parallel converter... I thought about...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.