Parallel port programming

Discussion in 'C Programming' started by karan, Oct 18, 2004.

  1. karan

    karan Guest

    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
    karan, Oct 18, 2004
    #1
    1. Advertising

  2. karan <> 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 () ------------- 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
    Joona I Palaste, Oct 18, 2004
    #2
    1. Advertising

  3. karan

    karan Guest

    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 <> wrote in message news:<cl07c5$on8$>...
    > karan <> 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.
    karan, Oct 18, 2004
    #3
  4. karan <> 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 () ------------- Finland --------\
    \-------------------------------------------------------- rules! --------/
    "You will be given the plague."
    - Montgomery Burns
    Joona I Palaste, Oct 18, 2004
    #4
  5. karan

    Chris Torek Guest

    In article <>,
    karan <> 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.
    Chris Torek, Oct 18, 2004
    #5
  6. On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , (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 =---
    Mark McIntyre, Oct 18, 2004
    #6
  7. On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , (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 =---
    Mark McIntyre, Oct 18, 2004
    #7
  8. On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , (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 =---
    Mark McIntyre, Oct 18, 2004
    #8
  9. On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , (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 =---
    Mark McIntyre, Oct 18, 2004
    #9
  10. karan

    Jack Klein Guest

    On 18 Oct 2004 10:25:51 -0700, (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/~ajo/docs/FAQ-acllc.html
    Jack Klein, Oct 19, 2004
    #10
  11. karan

    pete Guest

    Jack Klein wrote:
    >
    > On 18 Oct 2004 10:25:51 -0700, (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
    pete, Oct 19, 2004
    #11
  12. On 18 Oct 2004 10:25:51 -0700, in comp.lang.c , (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 =---
    Mark McIntyre, Oct 20, 2004
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. karthik
    Replies:
    5
    Views:
    11,004
    Dale King
    Jul 25, 2003
  2. Paul Perrone
    Replies:
    0
    Views:
    14,428
    Paul Perrone
    Aug 21, 2003
  3. b3ny
    Replies:
    11
    Views:
    921
    Babu Kalakrishnan
    Nov 20, 2004
  4. Novice Experl
    Replies:
    6
    Views:
    6,693
    c d saunter
    Aug 3, 2005
  5. Soren
    Replies:
    4
    Views:
    1,257
    c d saunter
    Feb 14, 2008
Loading...

Share This Page