"Interfacing the IBM PC parallel printer port" - читать интересную книгу автора (Stewart Z.) at least 0.5 uS delay
Pulse -Strobe low for at least 0.5 uS hold Data Out for at least 0.5 uS after end of -Strobe pulse Some time later, printer will pulse -Ack low for at least 5 uS Printer may lower +Busy when it raises -Ack at end of pulse Set other Control outputs or check Status inputs as desired. 9. BIOS Printer Support The PC ROM BIOS detects and initializes the printer ports on bootup, and provides printer support via INT 17 (and indirectly uses this in INT 5 "Print Screen"). The detection and building of a printer port base address table is described in the Soft Addresses section above. To control the printer via the BIOS, call INT 17 with the printer number in DX (0 to 3, indexing into the four entry table at 0x408 mentioned in the Soft Addresses section above), and the desired function in AH. Functions: AH = 0: print the character in AL AH = 1: reinitialize the port, return status in AH AH = 2: return status in AH BIOS operation notes follow. The BIOS normally keeps the Control register value as 0x0C: C4 = 0 => IRQ disabled C3 = 1 => -Select pin low (Printer Selected) C2 = 1 => -Init pin high (Printer not being initialized) C1 = 0 => -AutoFeed pin high (No Auto Feed) C0 = 0 => -Strobe pin high (No Stobe) The BIOS prints a character (function AH = 0) as follows: (Uses only Status in S7/+Busy and Control out C0/-Strobe) Write character to Data Out (D0-D7) Wait for bit S7 to go to 1 (-Busy pin to go high/low?) Timeout and return if this takes too long Set C0 to 1 for a few microseconds (-Strobe pin pulsed low) This assumes that the printer was already ready. The BIOS handles reinitializing the printer (function AH = 1) thus: Set C2 = 0 for a few hundred microseconds (-Init pin pulsed low) The BIOS returns status in AH (functions AH = 1 or 2) is as follows: __________________________________ | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 | | | | | | not used |___ 1 = "Time Out" (software) | | | | |________________ 1 = "I/O Error" (inv C3+; -Error pin low) |
|
|