If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. |
|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Linux to emulate/act as a printer.
Hello,
I have a device which outputs data to a printer. I have to collect these data and do smth with them. Today (working already 15+hours), i read a lot about parallel port and how data is transmitted/received, so i wired my own cable: data to data, pin 1 (at pc) to pin 11 (at device), so i could write not busy pin 10 (at pc) to pin 1 (at device), so i could read strobe pin 16 (at pc) to pin 10 (at device), so i could write ack pin 17 (at pc) to pins 12 and 15 (at device), so i could write not out of paper and not error (tell that nothing is wrong with printer) ground to ground, other cables not used. My idea is to control the status registers, so i (linux box) could act as a real printer, for example if i saw 'strobe low' (reading status ack (pin 10 at pc which is connected to device's pin 1), i'd know device is sending a byte, i would acknowledge that (by writing to pin 16) and continue reading byte by byte. Unfortunately something is wrong. I have tested the wiring - it is ok. I know about hardware invertion in parallel port, so i high and low pins correctly. The device just holds 'strobe' high, data bit 2 high and data bit 4 high. As i understand the device waits me (printer) to low busy, and do the same to error and out of paper. I have done it but the device never changes those strobe, bit2 and bit4. If i connect the device to a printer, the printer prints data out perfectly. I dont have so advanced devices to trap printer and device to see their conversation.. So something is wrong, i must ask if i have have understood how the printers work correctly: 1) If there is no paper or is error, those pins are set high. 2) Printer sets busy low, indicating it is ready to accept data 3) Device sets data pins high, putting a byte on the wire, and sets strobe low. 4) Printer sets busy high, indicating it is processing data 5) Printer reads data pins. 6) Printer sets busy low, sets ack low, waits ~ 5us, highs ack 7) goto 1, procedure continues. Am i correct? Also, please, if you know how to do this easier, be so kind and tell me. Thanks, P.Krumins |
#2
|
|||
|
|||
On 26 Dec 2003 04:21:47 GMT, Peteris Krumins
wrote: Hello, I have a device which outputs data to a printer. I have to collect these data and do smth with them. Today (working already 15+hours), i read a lot about parallel port and how data is transmitted/received, so i wired my own cable: data to data, pin 1 (at pc) to pin 11 (at device), so i could write not busy pin 10 (at pc) to pin 1 (at device), so i could read strobe pin 16 (at pc) to pin 10 (at device), so i could write ack pin 17 (at pc) to pins 12 and 15 (at device), so i could write not out of paper and not error (tell that nothing is wrong with printer) ground to ground, other cables not used. My idea is to control the status registers, so i (linux box) could act as a real printer, for example if i saw 'strobe low' (reading status ack (pin 10 at pc which is connected to device's pin 1), i'd know device is sending a byte, i would acknowledge that (by writing to pin 16) and continue reading byte by byte. Unfortunately something is wrong. I have tested the wiring - it is ok. I know about hardware invertion in parallel port, so i high and low pins correctly. The device just holds 'strobe' high, data bit 2 high and data bit 4 high. As i understand the device waits me (printer) to low busy, and do the same to error and out of paper. I have done it but the device never changes those strobe, bit2 and bit4. If i connect the device to a printer, the printer prints data out perfectly. I dont have so advanced devices to trap printer and device to see their conversation.. So something is wrong, i must ask if i have have understood how the printers work correctly: 1) If there is no paper or is error, those pins are set high. 2) Printer sets busy low, indicating it is ready to accept data 3) Device sets data pins high, putting a byte on the wire, and sets strobe low. 4) Printer sets busy high, indicating it is processing data 5) Printer reads data pins. 6) Printer sets busy low, sets ack low, waits ~ 5us, highs ack 7) goto 1, procedure continues. Am i correct? Keep in mind some of the lines are electrically inverted from their logical apppearance. Some lines might also be open collector. What I'd do is get an LPT testing app for the host PC, and something similar for the linux PC. Also, please, if you know how to do this easier, be so kind and tell me. Easier would be to use serial, with a null modem cable. Thanks, P.Krumins |
#3
|
|||
|
|||
Posted and emailed:
Peteris Krumins wrote: Hello, I have a device which outputs data to a printer. I have to collect these data and do smth with them. Today (working already 15+hours), i read a lot about parallel port and how data is transmitted/received, so i wired my own cable: data to data, pin 1 (at pc) to pin 11 (at device), so i could write not busy pin 10 (at pc) to pin 1 (at device), so i could read strobe pin 16 (at pc) to pin 10 (at device), so i could write ack pin 17 (at pc) to pins 12 and 15 (at device), so i could write not out of paper and not error (tell that nothing is wrong with printer) ground to ground, other cables not used. My idea is to control the status registers, so i (linux box) could act as a real printer, for example if i saw 'strobe low' (reading status ack (pin 10 at pc which is connected to device's pin 1), i'd know device is sending a byte, i would acknowledge that (by writing to pin 16) and continue reading byte by byte. Unfortunately something is wrong. I have tested the wiring - it is ok. I know about hardware invertion in parallel port, so i high and low pins correctly. The device just holds 'strobe' high, data bit 2 high and data bit 4 high. As i understand the device waits me (printer) to low busy, and do the same to error and out of paper. I have done it but the device never changes those strobe, bit2 and bit4. If i connect the device to a printer, the printer prints data out perfectly. I dont have so advanced devices to trap printer and device to see their conversation.. So something is wrong, i must ask if i have have understood how the printers work correctly: 1) If there is no paper or is error, those pins are set high. 2) Printer sets busy low, indicating it is ready to accept data 3) Device sets data pins high, putting a byte on the wire, and sets strobe low. 4) Printer sets busy high, indicating it is processing data 5) Printer reads data pins. 6) Printer sets busy low, sets ack low, waits ~ 5us, highs ack 7) goto 1, procedure continues. Am i correct? Also, please, if you know how to do this easier, be so kind and tell me. May I suggest an off-the-shelf parallel to serial converter? This will allow you to use standard code to read from your device and avoid the special cable which will mystify anybody who has to maintain your application. Thanks, P.Krumins |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
pc problems after g card upgrade + sp2 | ben reed | Homebuilt PC's | 9 | November 30th 04 01:04 AM |
Epson USB printer on Linux | Edward | General Hardware | 2 | April 28th 04 03:15 PM |
Linux to emulate/act as a printer. | Peteris Krumins | General | 0 | December 26th 03 04:22 AM |
deskjet 845 C ink | Pascal | Printers | 2 | November 17th 03 09:16 AM |
Printer recommendation (color inkjet, low per-page cost, OS/2 and Linux compatible) | Timur Tabi | Printers | 27 | July 16th 03 03:14 PM |