By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,314 Members | 1,793 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,314 IT Pros & Developers. It's quick & easy.

Parallel port programming

P: n/a
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
Share this Question
Share on Google+
11 Replies


P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 (4039.22'N, 11150.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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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

P: n/a
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 discussion thread is closed

Replies have been disabled for this discussion.