<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>
Date   : Sun, 24 Jan 1999 00:18:45 +0100
From   : "Mark Usher" <marku@...>
Subject: Paralel Cable

JGH wrote:

> So, effectively:
>
> USER  CB2  -> ~ERROR   PRINTER
> PORT  CB1 <-  D4        PORT
>        D7 <-  SELECT                  So this needs a loop polling D7
>        D6  -> PaperOut                on the user port to see if there
>        D5  -> ~BUSY                   is data to collect on D0-D3
>        D4  -> ~ACK
>        D3 <-  D3                      Or is this a 'standard' laplink
>        D2 <-  D2                      wiring method?
>        D1 <-  D1
>        D0 <-  D0
Yes, this is the standard laplink wiring method.
Instead of polling D7, when transmitting the nibble you just OR 64 the
nibble and this will set the interrupt on CB1. That or put a NOT gate in the
line :-)
This works on the PC as this is attached to the recievers -BUSY and because
of inverse logic on the line, the receiver has 1.

Actuall I made a slight mistake. The -Error and -BUSY should be swapped so
it would look like this.
USER  CB2 -> -BUSY    PRINTER
PORT  CB1 <- D4        PORT
       D7 <- -ERROR
       D6 -> SELECT
       D5 -> PaperOut
       D4 -> -ACK
       D3 <- D3
       D2 <- D2
       D1 <- D1
       D0 <- D0

This way the nibbles in the two registers are always together. Helps alot
with programming :-)

> I made up my lead as follows:
> USER  CB2              PRINTER        So this way, when writing a byte
> PORT  CB1 <-  SELECT    PORT          to the printer port, when the data
>        D7  -> ~ACK                    is present, SELECT is raised, and
>        D6  -> ~BUSY                   the user port can be programmed to
>        D5  -> ~ERROR                  interupt on CB1 and so automatically
>        D4  -> PaperOut                collect the data in D0-D3
>        D3 <-  D3
>        D2 <-  D2                      ~BUSY and ~ERROR may have been the
>        D1 <-  D1                      other way around, but I remember
>        D0 <-  D0                      that ~ACK was D7, and the ~signals

I tried to keep to the 4bit standard as I already have some reliable source
code to test it out.
The standard method works like this:

1) The sender begins the data transfer with the low nibble. It writes these
bits to data lines D0 - D3 and sets the value of D4 to 0 so the receiver
will get a value of 1 at its BUSY pin.

2) The receiver has been waiting for the value of the BUSY bit to change to
1. It then writes the nibble it recieved to data lines D0 - D3 to return it
to the sender. To indicate it has received the nibble, the D4 bit is set to
0 so the sender's BUSY bit will change to 1.

3) The sender has been waiting for its BUSY bit to change to 1. It then
writes the high nibble to the data lines and ses D4 to 1. This changes the
value of the recievers BUSY bit to 0.

4) This time, the receiver has waited for the BUSY bit to change its value
to 0. The received nibble is again returned to the sender and the data bit
D4 is set to 1. The sender will then get a value of 0 for its BUSY bit.

5) The communication is completed. The receiver reassembles the byte from
the two nibbles and the sender checks the data returned from the receiver to
make certain there were no data transfer errors.

Mark

ref: PC Intern / Abacus Software.
<< Previous Message Main Index Next Message >>
<< Previous Message in Thread This Month Next Message in Thread >>