Low level signalling

This describes the low level (wire level) signalling used by the NEX.

Data transmission

There are two ways of sending a byte to the NEX. Lacking a better description, they are called the 08 way and the 02 way.

Both ways use the same basic method: The data byte is presented on the LPT output pins, then a single output line is strobed. In the 08 case, this line is SELECT (inverted to pin 17), and in the 02 case the line is AUTOFEED (inverted to pin 14).

For example, the code for the 08 case is, in Delphi:
procedure SendByte08(DataByte : byte);
begin
  OutPortB($378, DataByte);
  OutPortB($37A, $08);
  OutPortB($37A, $00);
end;
The 02 form is the same but with 02 instead of 08.

Data reception

There is only one form of this, the 02 form. Here, the AUTOFEED line is raised, (so is lowered on the actual wire), and the lower four bits of the byte are read from the upper four bits of the parallel port "status" port (!BUSY, ACK, PAPER, and SELECTED, so pins 11, 10, 12, and 13). Then, the line is lowered and the upper four bits are read from the same location.

The pascal code for this is:
function RecvByte02 : byte;
var
  TmpDat  : byte;
begin
  OutPortB($37A, $02);
  TmpDat := InPortB($379);
  OutPortB($37A, $00);
  Result := (InPortB($379) and $F0) or (TmpDat shr 4);
end;