RE: [PARPORT] Parport as a serial port?

From: MERRETT, David (david.merrett@baesystems.com)
Date: Thu Jan 30 2003 - 01:53:15 EST

  • Next message: Juan Pablo Martinez Sanchez: "RE: [PARPORT] Parport as a serial port?"

    Well... doesnt anyone have a sense of adventure here...?
    Remember serial data is kinda slow.. at 9600 bps,
    the bits are comin at you at a mere 1 every 100 uS.

    To do this, you'd need an interupt routine (in kernal ?) able to catch the
    bits, and collate them into bytes..essentially emulate the serial chip,
    (Usually 16550 compat.)

    You'd probably need to fast access the PC clock, so you could record when
    the bits arrived, and/or ( once you are certain of the baud rate), you could
    initiate your own timer interupt (AFTER the first "start bit" detection, to
    sequentially trigger 8 ( or 9 as per No. bits) polls on the PP bit being
    sampled, while keeping track of the 'state' of your 'serial emulator', so
    that it knows what bit is next to be added to byte ( or are we waiting for
    first bit?), parity, stop bits, time-outs, error detection etc.
    Writing Data out should be far more trivial.. just initiate timer to trigger
    calls to driver until out put buffer is empty.
    Then all you have to do is encapsulate it in something that looks like a
    serial port driver.
    I would consider writing the basic operations in assembly language for speed
    Implementing all the Serial handshaking stuff may be optional in your
    application, and shouldnt be too hard anyway (compared to receiving bits!)

    This is like designing a new SW interface for a new HW interface.
    Im guessing if you're a Great linux programmer, at least a full month of
    full-time Software development to get all the bugs out.
    Most people (like me) would agree its far less effort to solve probs with
    serial interface.
    But we dont know how hard that is yet...
    (How about adding a new serial Interface ISA?PCI?USB?PCMCIA? card?)

    On the other hand, If anyone actually wrote such a driver, You could
    potentially have FOUR serial ports on ONE PC PP....

    Oh-yeah, and ofcourse, you'd little adaptor circuit to convert from the
    PP's 0to+5 volt output into -12to+12 volt output.

    dave.
    -----Original Message-----
    From: Jeff Silverman [mailto:jeffs@commercialventvac.com]
    Sent: Thursday, 30 January 2003 15:38
    To: Juan Pablo Martinez Sanchez
    Cc: linux-parport@torque.net
    Subject: Re: [PARPORT] Parport as a serial port?

    Juan Pablo Martinez Sanchez wrote:

    >Hi all, i'm new to this mailing list, i have a doubt about the use of the
    >parallel port. Before to put the doubt i explain briefly my application:
    >i'm making a mobile bot, in the control layer i'm using a laptop connected
    >to a microcontroller. The micro has a uart, so in principle i have to use
    >the serial port in the laptop, but i have a lot of problems to use it, so
    >i would ask to you about a way to use the parallel port as a serial port?.
    >
    >Any suggestions are well received. Thanks,
    >
    >
    >Juan Pablo Martinez.
    >
    >
    >
    >-- To unsubscribe, send mail to: linux-parport-request@torque.net --
    >-- with the single word "unsubscribe" in the body of the message. --
    >
    >
    Using a parallel port as a serial port is lunacy.

    Let's talk about your troubles with the serial port. I realize that is a
    little off topic for this list. You should have no problems getting two
    computers to talk to each other using serial.

    Jeff

    -- 
    Jeff Silverman, Linux Guru wannabe, Java Guru wannabe
    

    -- To unsubscribe, send mail to: linux-parport-request@torque.net -- -- with the single word "unsubscribe" in the body of the message. --

    -- To unsubscribe, send mail to: linux-parport-request@torque.net -- -- with the single word "unsubscribe" in the body of the message. --



    This archive was generated by hypermail 2b29 : Thu Jan 30 2003 - 01:57:43 EST