03-24-2008 12:04 PM
03-25-2008 03:06 PM
03-26-2008 11:40 AM
Thanks O_Proulx! I will try changing the BIOS setting on both Win XP systems. But utltimately our intention is to monitor the data send and received by a Win 3.1 system and I am not sure, if its parallel port mode can be changed to bi-directional.
04-23-2008 11:01 AM
Hi KC, nqn827
I followed you guys' advice to monitor the data transferred between the host PC (win 3.1) and the peripheral (vision system).
The setup is like this. My monitor PC (win xp) has two parallel ports - port1, port2. Both are PS/2. Port1 is connected to host PC's i/o port using a cross over cable whose connection is in the code attached. Port2 is connected to the peripheral's i/o port using straight through 25 pin cable. Wrote a monitor program to read port1 and port2 and send the status byte from peripheral to host PC and the control byte from host PC to the peripheral. The data byte is copied from port 1 to port 2 or the other way based on the host PC's strobe bit. If the strobe bit is 1 (signal is low), data byte of port1(c5=1, data is input) is copied to port2(c5=0, data is output) and vice versa.
The mechanism works partially. When the software on host PC starts, it send the contents of a known file to the peripheral using proper handshake "compatibility mode" as confirmed from my monitor's log. After the file is downloaded, it expect to receive something back from the peripheral. For some reason, this is not happening. So the software on host PC reports, "download complete but device failed to start" and quit running. The communication is definitely slowed down by this mechanism, but I don't understand why the peripheral fails to send data back to the host PC. Do anyone know what I am doing wrong here?
The program use publicly available "inpout32.dll" to read and write to parallel ports and is attached.
Thanks...
04-24-2008 03:57 PM
04-25-2008 01:14 AM
Hi Aro,
Can you provide more info ?
Like the program (LV I hope) you use. A despription of the protocol. etc.
04-25-2008 09:05 AM - edited 04-25-2008 09:09 AM
Hi O_Proulx, KC
The program is attached to my last post. The peripheral is receiving the file from the log below which shows the handshake between host PC (CONTROL1) and peripheral (STATUS2). When host set strobe bit c0=1 (CONTROL1) at port1, my monitor set c5=1 at port1 and c5=0 at port2 and copy DATA1 to DATA2 so that the character 'S' set by host appear at the peripheral. The peripheral whose busy bit s7=1 (STATUS2) till now change to s7=0. Seing that s7=0, host set strobe bit c0=0 (CONTROL1). The peripheral by now have read 'S' from DATA2 sets s7=1 (STATUS2) again ready for the next byte of data. The host continues to send the next byte.
10:48:16, CONTROL1 = (00001101); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 36 (00100100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
10:48:16, CONTROL1 = (00101101); STATUS1 = (11011000); DATA1 = 83 {S} (01010011) CONTROL2 = 13 (00001101); STATUS2 = 88 (01011000); DATA2 = 255 {ÿ} (11111111)
10:48:16, CONTROL1 = (00101100); STATUS1 = (01011100); DATA1 = 83 {S} (01010011) CONTROL2 = 13 (00001101); STATUS2 = 88 (01011000); DATA2 = 83 {S} (01010011)
10:48:16, CONTROL1 = (00001100); STATUS1 = (01011000); DATA1 = 83 {S} (01010011) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
10:48:16, CONTROL1 = (00001101); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
10:48:16, CONTROL1 = (00101101); STATUS1 = (11011000); DATA1 = 48 {0} (00110000) CONTROL2 = 13 (00001101); STATUS2 = 88 (01011000); DATA2 = 255 {ÿ} (11111111)
10:48:16, CONTROL1 = (00101100); STATUS1 = (01011100); DATA1 = 48 {0} (00110000) CONTROL2 = 13 (00001101); STATUS2 = 88 (01011000); DATA2 = 48 {0} (00110000)
10:48:16, CONTROL1 = (00001100); STATUS1 = (01011000); DATA1 = 48 {0} (00110000) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
10:48:16, CONTROL1 = (00001101); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
At the end of transmission
11:08:41, CONTROL1 = (00001101); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
11:08:41, CONTROL1 = (00101101); STATUS1 = (11011000); DATA1 = 48 {0} (00110000) CONTROL2 = 13 (00001101); STATUS2 = 88 (01011000); DATA2 = 255 {ÿ} (11111111)
11:08:41, CONTROL1 = (00101100); STATUS1 = (01011100); DATA1 = 48 {0} (00110000) CONTROL2 = 13 (00001101); STATUS2 = 88 (01011000); DATA2 = 48 {0} (00110000)
11:08:41, CONTROL1 = (00001100); STATUS1 = (01011000); DATA1 = 48 {0} (00110000) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
11:08:41, CONTROL1 = (00001100); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
11:08:41, CONTROL1 = (00001100); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
11:08:41, CONTROL1 = (00001100); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
11:08:41, CONTROL1 = (00001100); STATUS1 = (11011000); DATA1 = 255 {ÿ} (11111111) CONTROL2 = 44 (00101100); STATUS2 = 216 (11011000); DATA2 = 255 {ÿ} (11111111)
After host send last character '0', nothing happens on CONTROL1 or STATUS2. It stays the same. Notice that c5=0 (CONTROL1) meaning port 1 data is now output and c5=1 (CONTROL2) meaning port2 data is input. Also host's strobe c0=0(CONTROL1), so it is ready to receive. All bits at all register stays the same for ever and host software displays error that file downloaded but peripheral wouldn't start.
04-28-2008 04:01 PM
04-28-2008 04:44 PM
Hi O_Proulx,
For the parallel port, the control lines c0..c3 are physical TTL lines controlled by the PC which can be seen at the printer side. Rest of the lines c4..c7 are internal register entries set by PC/printer for their respective ports. Similarly the status lines s3..s7 are physical TTL lines controlled by the printer which can be seen at the PC side and rest of the lines are internal register entries set by printer/PC for their ports. All data lines d0..d7 are physical TTL lines. For PS-2 type bi-directional parallel ports, the data lines can be set as input or output with respect to the PC by setting PC's control register bit c5. At PC side if we set c5=1, then the data lines become input to PC port. Any software on the PC if it reads the data lines will see the value set by printer and vice versa if host PC set c5=0.
In connection 1 from host PC to port1 of monitor PC, strobe bit c0 can only be set by host PC. It cannot be set by monitor PC because this c0 (pin1) voltage from host PC's port will appear at s6 (pin10) of the monitor PC's port 1 as we are using a cross over cable. From monitor PC port1's point of view the host PC is a printer and vice versa.
04-29-2008 11:10 AM