IEEE 1284 - Centronics Interfejs Centronics w wersji oryginalnej - łącze jednokierunkowe przesyłające informacje od komputera do drukarki przeznaczony jedynie do tego zadania, co wynikało z braku potrzeby dwukierunkowej komunikacji z drukarką. LPT port addresses Parallel Port LPT1: LPT2: I/O Addresses 0x378-0x37F 0x278-0x27F 1
Mody pracy portu rówloległego IEEE 1284: 5 trybów Niektóre pozwalają na prace dwukierunkową Compatibility mode (supports output only) Nibble mode Byte mode ECP mode (Extended Capabilities Port) 2.4 Mbytes/s EPP mode (Enhanced Parallel Port) 2
Opis linii sygnałowych SPP EPP ECP Source Data8-1 AD8-1 Data8-1 Host/Peripheral STROBE* WRITE* HostClk Host AUTOFD* DSTROBE* HostAck Host INIT* INIT* ReverseRequest* Host SelectIn* ASTROBE* 1284 Active Host ACK* INTR* PeriphClk Peripheral BUSY WAIT* PeriphAck Peripheral PError User Defined AckReverse* Peripheral Select User Defined XFlag Peripheral FAULT* User Defined PeriphRequest* Peripheral 3
Handshake Compatibility mode Standard Parallel Port (SPP) One Handshake Cycle 4
Rejestry w trybie SPP Zdefiniowane są 3 adresy do dostępu rejestrów LPT1: odpowiada odresowi bazowemu 0x378 Bazowy używany do wysyłania danych (D0-D7) Bazowy +1 rejestr statusu Bazowy +2 rejest controlny 0x378 0x379 0x37a Write D7D6 D5 D4 D3 D2 D1 D0 --- D IQ SI IN AF ST Read D7D6 D5 D4 D3 D2 D1 D0 Bsy Ack PE SL ERR IRQ D IQ SI IN AF ST 5
Dostęp do portu 6
EPP handshake adresów 7
EPP handshake danych 8
Rejestry w trybie EPP Register Read or Write Register Offset Parallel Port Data Register Write/Read 0 Parallel Port Status Register Read 1 Parallel Port Control Register Read/Write 2 Auto Address Strobe Register Read/Write 3 Auto Data Strobe Register Read/Write 4 Auto Data Strobe Register Read/Write 5 Auto Data Strobe Register Read/Write 6 Auto Data Strobe Register Read/Write 7 9
EPC - handshake 10
Rejestry w trybie EPC Register Offset Data Register 0 Status Register 1 Control Register 2 ECP Address FIFO Register 0 ECP Data FIFO Register 400 ECP Data FIFO Upper Register (optional) 401 Test FIFO Register (ECP FIFO Mode) 400 Test FIFO Upper Register (ECP FIFO Mode) 401 Configuration Register A (ECP Config. Mode) 400 Configuration Register B (ECP Config. Mode) 401 Extended Control Register 402 11
IEEE 1284 -negocjacje 12
Bajt Extensibility Extensibility Byte Definition Description 1000 0000 Request Extensibility Link This byte is used to add a second extensibility request byte to the negotiation phase. This allows for mode modes in the future. 0100 0000 Request EPP Mode 0010 0000 Request ECP Mode with RLE ECP mode with run-length encoding (RLE) data decompression 0001 0000 Request ECP Mode ECP mode without data decompression 0000 1000 Reserved Reserved for future use 0000 0100 Request Device ID using Nibble Mode Receive the Device ID a nibble at a time across the status lines 0000 0101 Request Device ID using Byte Mode Receive the Device ID a byte at a time across the data lines. 0001 0100 Request Device ID using ECP Mode without RLE 0011 0100 Request Device ID using ECP Mode with RLE 0000 0010 Reserved Reserved for future use 0000 0001 Byte Mode Reverse Channel Transfer 0000 0000 Nibble Mode Reverse Channel Transfer Receive the Device ID without ECP data compression Receive the Device ID with ECP data compression Use the data lines bidirectionally to send data from the peripheral to the host. Use the parallel port status lines to send data one nibble at a 13 time from the peripheral to the host.
Windows 2k biblioteka dlportio, winio, Port IO Driver plik dlportio.sys plik dlportio.dll =>ścieżka systemowa plik dlportio.lib ->dołączamy do projektu plik dlportio.h ->nagłówki dodawane przez #include xxx.h =>katalog \Winnt\system32\drivers UCHAR DlPortReadPortUchar(ULONG Port) VOID DlPortWritePortUchar(ULONG Port,UCHAR Value) 14
C++Builder #include <vcl.h> #include "Dlportio.h" void fastcall TForm1::Button1Click(TObject *Sender) { } DlPortWritePortUchar(0x378,0x00); DlPortWritePortUchar(0x37a,0x0f); 15
Laboratorium 16