Re: [PARPORT] Simple C prog needed

From: Blaise Gassend (blaise@gassend.com)
Date: Fri Jan 10 2003 - 10:51:53 EST

  • Next message: Miroslav BENES: "[PARPORT] pd.o module with delay=0 && mode=5 options"
  • Next message: Miroslav BENES: "[PARPORT] PCI cards with NetMos chips 9835 & 9715"

    Hi Tim,

    It sounds to me like you want to be able to send 8 different bits to
    your device: 3 address bits, 4 data bits, and one write bit. That's
    great as you can assign one bit to each of the parallel port's data
    bits.

    You can then use a single echo | dd command to set all these bits
    exactly as you want them and produce the timing diagram you drew (though
    I think there is an error on the second data change as the write pin
    hasn't changed).

    I have answered your other questions below:

    > Well, I want the strobe but not to have to send anything back to the port from
    > my device. Here's what the LED display driver information says:
    >
    > 'Data can be written by setting up a 3 bit binary code on the digit address
    > inputs and applying a low level to the WRITE pin.'
    >
    > The timing diagram is something like this:
    >
    > Address ---\/-----------------------\/-------
    > bits ---/\-----------------------/\-------
    >
    > WRITE ---------\ ------------
    > pin --------------/
    >
    > Data ---------------\/---------------\/---
    > ---------------/\---------------/\---
    >
    > 1. Set the 3 address pins and hold them.
    > 2. Set WRITE pin low.
    > 3. Set the 4 data pins and hold then.
    > 4. Set WRITE pin high.
    > 5. Now I can't change anything (or so I think)
    >
    > Since it's 4 data bits, 3 address bits and one WRITE bit needed, I guess I
    > _could_ manage without the printer handshake. Is it the

    Yes, and you should, the printer handshake isn't exactly what you want,
    and if you use the printer handshake, you will have to acknowledge it.

    > echo -ne \\377 | dd of=/dev/port bs=1 seek=$((3*256+7*16+8))
    >
    > line I want then? What does the double backslash do? And could you explain the

    \\377 means character 255.

    > seek option a bit more? I've read the man page but don't get that part.

    The reading and writing /dev/port is like reading and writing io ports.
    the seek=... argument tells dd which port to write to. The argument is
    given in a way that makes the hexadecimal value of the port (0x378)
    explicit. You could just as easily write seek=888 in this case.

    Blaise Gassend

    -- 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 : Fri Jan 10 2003 - 10:54:03 EST