Connect with us

Printer Port

Discussion in 'Electronic Design' started by Wong, May 13, 2004.

Scroll to continue with content
  1. budgie

    budgie Guest

    It doesn't actually. Try it some time.
    No, I like mine beacuse it fits on one line without being cryptic, and it works.
    I do too. At least we agree on one thing :)
     
  2. Bob Masta

    Bob Masta Guest

    To enlarge on what others have posted, note that you need Win9x
    or earlier to access the printer port without a special driver. For
    NT, 2K, or XP you need a kernel driver. See Jan Axelson's site
    at <www.lvr.com> for more info.

    Also note that it's good programming practice in DOS to never
    assume the port address is 378h or anything else. Instead,
    you should read it from the BIOS. The word at 0:408h is the
    base address of LPT1, 40Ah is the address of LPT2, 40C is
    LPT3, and 40E is LPT4. Of course, most systems never had
    more than one LPT anyway, but it's location wasn't always a
    sure thing. In the early days it was a separate card, and could
    be jumpered to various addresses. You might have had an
    LPT on a graphics adapter as well.

    Hope this helps!


    Bob Masta
    dqatechATdaqartaDOTcom

    D A Q A R T A
    Data AcQuisition And Real-Time Analysis
    www.daqarta.com
     
  3. Rich Grise

    Rich Grise Guest

    OK, it clears them all except the 04 bit, which it sets.
    Unless your BASIC interpreter does it different - for example,
    FF AND 04 yields 04 on every system I've ever used, and every
    book about it that I've read.

    Or maybe 37A is open-collector (I'd have to look it up), in
    which case if there are pullups, those bits will go high -
    but not because of what's been output. (outputted? :) )

    And some of the bits are inverted, I also would have to look
    up which bits - but the value of the data is as I said.

    Thanks,
    Rich
     
  4. Here is the C version (I use 2 strings off i2c chips on the parport (6 pins in use plus ground):

    sdal()
    {
    register a;
    a = inb(par_port_address);
    a = a & 0xbf; /* reset bit 6 (d6 on pin 8) */
    outb(a, par_port_address);
    busdly(IIC_BUS_DELAY);
    }


    sdah()
    {
    register char a;
    a = inb(par_port_address);
    a = a | 0x40; /* set bit 6 (d6 on pin 8) */
    outb(a, par_port_address);
    busdly(IIC_BUS_DELAY);
    }
     
  5. It is for this reason and things that one should ask the BIOS what the address is.
    JP
     
  6. Florian

    Florian Guest

    s/sets/leaves untouched/

    (snip)
     
  7.  
  8. -----------
    All pins serviced by 37A ( ar any LPT base + 2 control address) are
    open-collector outputs, and bits -C0, -C1, -C3 are inverted, while
    C2, the "4's" bit in binary, is not.

    -Steve
     
  9. Rich Grise

    Rich Grise Guest

    NO, Dangit! That's wrong! An open collector is a current
    sink when it's set to 0. Duh! And I was sober when I posted
    that! I'm ashamed of myself.

    I might have been thinking of the inverted bits, see next
    sentence. Just now I thought of using thinking of tri-state
    as an excuse, but that's even lamer.
    A thousand pardons, sirs and mesdames.

    Rich
     
  10. budgie

    budgie Guest


    Whoops - red face time :-((

    Should have been OR not AND.

    OUT 37A, (INP(37A) OR 04)
     
  11. -----------
    Yes, agreed, unless you happen to know already.
    Any generalized software should do this by looking at RAM address
    408 Hex :
    -d 0040:0008 L8
    0040:0008 78 03 78 02 00 00 00 00

    Note, the address is listed LO byte then HI byte
    "78 03" instead of 0378 Hex, as Intel is Little Endian first.

    Or in BASIC:

    10 For i = 8 to 15
    20 Print Peek(1024 + i)" ";
    30 Next i
    40 Print

    -Steve
     
  12. ------------------------
    Since it is the only one not inverted, a 1 in the "4's" but
    SETS its output HI.

    ----------------------
    God didn't make anybody any clothing. Don't be stupid. Has God
    ever made you a suit?

    Did you know that "Genesis" was not original, that it was actually a
    child's tale from Balylonian scrolls much older than Judaism?? The
    Jews just picked it up during their slavery in Iraq! It's not some
    "holy" book, it was meant to make kids keep their clothes on, because
    the rich kids who were told it could only be identified and protected
    if they wore clothes, which ONLY the rich of the king's court could
    afford!!

    -Steve
     
  13. Florian

    Florian Guest

    I'm not following you. Nothing's being inverted anywhere, and nothing's
    being set high. It's a simple AND. Are you saying a PC parallel port will
    perform some unexpected transformation on the values read and written?
    That's contrary to my experience. I'm confused.

    Heck, how would you know? Were you there?
    Not personally, no. You?

    (snip rest)
     
  14. Rich Grise

    Rich Grise Guest

    Of course. He's also built me five computers, a Winnebago LeSharo, MAME,
    TV, he grows me food and Marijuana, he brings me the words of all these
    fine people on electrical telephone lines that he had built for me, ...
    It's so fucking obvious that that's probably why it escapes you.

    The part that hasn't been obvious, and has been made unobvious for very
    many years for reasons that are just as unobvious, is the part that Will
    plays in all this.

    I have been given that answer, ergo, I am categorically insane. :)

    Cheers!
    Rich
     
  15.  
  16. ---------------
    Nope, never ever was on any computer from the AT, XT, and PC, back
    through all the CP/M machines.

    You're guessing, and that's silly.

    -Steve
     
  17. Nope, not guessin, in the 80ties I had the IBM BIOS listing.
    And full diagrams of cause (company workled with IBM).
    The Keyboard was one half of the 8255 PPI, 8 bit parallel in,
    and that was fed from some shift registers, serial clock to the keyboard,
    data from / to the keyboard.
    Some other bits were control I think. But was not the other half of
    that 8255 used for the printer port?
    Or was the printer port just a latch?

    OK, I just googled a bit I see you already knew this:
    http://www.xs4all.nl/~ganswijk/chipdir/abc/keyboard/keyboard.faq
    Version 0.9a IBM Keyboard/Scancode FAQ File Richard STEVEn Walz
    rel 10 June 1994 *please retain this banner*

    Oh well ;-)
    JP
     
  18. Rich Grise

    Rich Grise Guest

    I used to have "The IBM Personal Computer Technical Reference," which
    was pretty cool - the whole BIOS listing, and the whole schematic.
    I didn't do much with the keyboard, but ISTR seeing an 8048 or so -
    and the LPT port was straight TTL. When third parties came up with
    Chinese COM/LPT ports, they used some custom chip that blew out if
    you looked at it wrong - I finally got tired of replacing them, and
    built a little daughterboard where I exactly duplicated IBM's LPT
    port. Then, realizing that the chip I'd supplanted had the clocks for
    the UARTs, I built a little Pierce xtal oscillator with the collector
    choke made of about 150 turns of magnet wire on a toothpick, with
    pieces of resistor lead glued into tiny holes on the ends, so it
    looked like it had leads like any other part.

    But I've never seen or heard of an 8255 used for LPT.

    Cheers!
    Rich
     
  19. Yea, it seems it was a normal TTl latch (Sam will have to help us here).
    I actually designed cards for in the PC in that company.
    I made a soundcard, and it was used, and told the boss: 'Why don't you
    patent this?' (It had wavetable too), but he did not want to do that.
    He REALLY should have :)
    JP
     
  20. --------------------------
    Nope, the keyboard only. I have all the early PC schematics.

    --------------------------
    The original PC-LPT was the circuit I presented years ago,
    it was taken from a MGP video card 3BC Hex port LPT, and
    it is representative of the original PC LPT card.

    http://www.armory.com/~rstevew/Public/LPT/LPTskmtc_wid.html
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-