473,597 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3311
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.hel sinki.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.hel sinki.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.hel sinki.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.embed ded 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.i n (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.i n (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.i n (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.i n (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.i n (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.l earn.c-c++
http://www.contrib.andrew.cmu.edu/~a...FAQ-acllc.html
Nov 14 '05 #10

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

Similar topics

0
1881
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 parallel computation. Key Benefits of SocketPro: Super performance and scalability It is a guarantee that SocketPro based client-server applications
6
7233
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 2000. How can I do this? What do I need to know? It doesn't look like the standard library (the one under my pillow) has that feature. In addition, I've heard that with newer versions of windows don't let you communicate with the port directly,...
9
8426
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 port ie to send data and to read the state of the parallel port including the control lines. Can anyone help/point me in the correct direction? I have tried the help files and the internet but am unable to find anything relevant. Thanks in...
11
3847
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: linuxfocus.org/English/May2001/article205.shtml). However, I know that this will probably need to be done in low level C. Now, although I can code in C, I don't particularly want to :-) , instead I'd like to use Python. I'm wondering, is there any way I...
11
5260
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 the port. eg. 00000001 will set pin 1 high and flick the relay open. todate i've attempted this with merely open() on /dev/ppi0 and numpy for the byte array, but i just can't seem to get it working. i know the parallel port works and i know the...
1
5684
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 parallel port pins in java.
6
9306
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 XP. I want to know how can i access(read and write data) on parallel port in XP. I have a program that do the same thing but in its documentation it says that it will not work on Windows XP.
2
2745
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 - input only. Thanks in advance Pete
4
15299
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 using PyParallel, but the USB->Parallel converter doesn't actually map to the LPT port .. and PyParallel only looks for LPT ports? Has anyone tried doing this? What are my options for controlling parallel connections on a laptop with no parallel...
0
8263
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8254
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
6677
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5421
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
3876
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3917
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1492
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1226
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.