Information Technology Reference
In-Depth Information
D0
b 7
b 6
b 5
b 4
b 3
b 2
b 1
b 0
Data port (378h)
0
PtrBusy (BUSY)
AckDataReq (PE)
XFlag (SELECT)
DataAvail (ERROR)
1
b 7
b 6
b 5
b 4
b 3
b 2
b 1
b 0
Multiplexor
(1 of 2)
Status port (379h)
_outp(0x378,0); /* set lower 4 bits */
inval1=(_inp(0x379) & 0xf0) >> 4;
_outp(0x378,1); /* set upper 4 bits */
inval=(_inp(0x379) & 0xf0) +inval1;
Figure 17.4
Nibble mode for 8-bit input
17.4 Byte mode
The byte mode is often known as a bidirectional port and it uses bidirectional data lines. It
has the advantage over nibble mode in that it only takes a single cycle to transfer a byte. Un-
fortunately, it is only compatible with newer ports. Table 17.2 defines the names of the sig-
nal in the nibble mode and Figure 17.5 shows the handshaking for this mode.
The byte mode has the following sequence:
1. Host (PC) indicates that it is ready to receive data by setting HostBusy LOW.
2. The peripheral then places the byte on the status lines.
3. The peripheral indicates that the data is valid on the status line by setting PtrClk LOW.
4. The host then reads from the data lines and sets HostBusy HIGH to indicate that it has
received the nibble, but it is not yet ready for another nibble.
5. The peripheral sets PtrClk HIGH as an acknowledgement to the host.
6. Host then acknowledges the transfer by pulsing HostClk.
 
Search WWH ::




Custom Search