[LTP ECP] connecting PC to PC, reverse mode

  • Follow


Hello,
I would like to connect 2 PCs via the LPT port.
As I read the best mode to do this i ECP.
I would like both computers to "listen" in reverse mode and when one of them
wants to send something it goes to forward mode and sends. After that back
to reverse mode.
Is it possible (for a computer to be all the time in reverse mode and get
bytes when another sends them) ?
I'm trying to do so (based on http://www.fapo.com/files/ecp_reg.pdf) but i
never receive packets.

My procedure is:

1) output to port base_addr+2,00000000b (to initialize ECP, before switching
the mode, like in the docs)
2) output to port base_addr+402,01100000b (switch to ECP mode)
3) switch to reverse mode:
 - output to port base_addr+402,00100000b (to SPP, bi-directional for a
while)
 - output to port base_addr+2,XX1XXXXXb (change the direction, X means no
change)
 - output to port base_addr+402,01100000b (back to ECP)
4) now set nInit line low (output to port base_addr+2,XXXXX1XXb) in a loop
and read if the FIFO is empty (input base_addr+402, the least significant
bit)
If the command is to send something - switch to forward mode (just like to
reverse) and output to port base_addr+400, the byte.

It doesn't work...
The input FIFO is always empty and the output FIFO after sending 16 bytes is
full and never discharges.

Is there something wrong with my procedure?

I'm writing in assembler.
--
Tomek
Poland




0
Reply Tomek 6/23/2005 10:25:28 PM

Tomek Gruca wrote:

> Hello,
> I would like to connect 2 PCs via the LPT port.
> As I read the best mode to do this i ECP.
> I would like both computers to "listen" in reverse mode and when one of
> them wants to send something it goes to forward mode and sends. After that
> back to reverse mode.
> Is it possible (for a computer to be all the time in reverse mode and get
> bytes when another sends them) ?

I believe you are talking about a bi-directional port so it is listening
when it isnt transmitting. I dont think you have to worry about that.
do you have the proper cable? It will need to have some lines swapped to go
directly to another computer (like a null modem cable)
Eric


> I'm trying to do so (based on http://www.fapo.com/files/ecp_reg.pdf) but i
> never receive packets.
> 
> My procedure is:
> 
> 1) output to port base_addr+2,00000000b (to initialize ECP, before
> switching the mode, like in the docs)
> 2) output to port base_addr+402,01100000b (switch to ECP mode)
> 3) switch to reverse mode:
>  - output to port base_addr+402,00100000b (to SPP, bi-directional for a
> while)
>  - output to port base_addr+2,XX1XXXXXb (change the direction, X means no
> change)
>  - output to port base_addr+402,01100000b (back to ECP)
> 4) now set nInit line low (output to port base_addr+2,XXXXX1XXb) in a loop
> and read if the FIFO is empty (input base_addr+402, the least significant
> bit)
> If the command is to send something - switch to forward mode (just like to
> reverse) and output to port base_addr+400, the byte.
> 
> It doesn't work...
> The input FIFO is always empty and the output FIFO after sending 16 bytes
> is full and never discharges.
> 
> Is there something wrong with my procedure?
> 
> I'm writing in assembler.
> --
> Tomek
> Poland

0
Reply Eric 6/24/2005 8:23:35 AM


----- Original Message ----- 
From: "Eric" <spamtrap@crayne.org>
Newsgroups: comp.lang.asm.x86
Sent: Friday, June 24, 2005 10:23 AM
Subject: Re: [LTP ECP] connecting PC to PC, reverse mode


>
> I believe you are talking about a bi-directional port so it is listening
> when it isnt transmitting. I dont think you have to worry about that.
> do you have the proper cable? It will need to have some lines swapped to 
> go
> directly to another computer (like a null modem cable)
> Eric
>
Actually i wanted to communicate in ECP. The data ports in this mode are
bi-directional, and sending / receiving data should be as easy as to write
to / read from the FIFO.
After hours of fruitless tries i crossed the cable and switched spp mode.
Now everything works. It's of course much slower connection, but enought for
my needs.
Thx.

--
Tomek 


0
Reply Tomek 6/25/2005 5:10:24 PM

2 Replies
210 Views

(page loaded in 0.053 seconds)

Similiar Articles:





7/23/2012 10:58:07 PM


Reply: