B&B Electronics PPIO manual

Page 27

Input_Byte = inp( Control_Address ) & 0x0F;

if( (Input_Byte & Output_Byte) == Output_Byte )

{

status = 0x01;

}

}

/* Restore the state of the digital outputs */

Output_Byte = old_value;

outp( Base_Address, Output_Byte );

return (status);

}

This function writes A0h to the upper four digital outputs, then verifies that the digital output lines are in that state. Then it writes 50h to the upper four digital outputs and verifies that the digital outputs are in set properly. The lower four digital outputs are checked in a similar manner with the values 0Ah and 05h.

NOTE: If the PPIO is connected properly and the upper four outputs (4 - 7) are functional, but the lower four outputs (0 - 3) are not functional, the parallel port may be in ECP or EPP mode. It must be in “compatible” or “normal” mode for the PPIO to work properly. The mode of the parallel port can be changed in the BIOS setup by pressing either the F2 key or DEL key just after the computer begins the boot procedure.

For an example of an application that uses these functions, look at the source code in PPIO.C.

PPIO2899 Manual

25

B&B Electronics Mfg Co Inc – 707 Dayton Rd - PO Box 1040 - Ottawa IL 61350 - Ph 815-433-5100 - Fax 815-433-5104

Image 27
Contents Not Recommended for New Installations Table of Contents Introduction Packing List PC Parallel Port Description Page BIT PPIO2899 Manual Ppio Description & Connection PPIO2899 Manual Controlling the Ppio Using Gwbasic Bit Force I/O on Force I/O OFF Low High Page Begin Controlling the Ppio Using PascalElse Mask Value Function OutputBit BitNumberBYTE Byte Procedure SetOutputBit BitNumber,OutputBYTE XOR Controlling the Ppio Using C Void SetIRQOffvoid Outport ControlAddress Mask Value Page Page New PPIO2899 Manual Page Interfacing to the Ppio PPIO2899 Manual Example USE of the Ppio Page REM IB is the Input Byte and OB is the Output Byte Appendix Hexadecimal NumbersBinary Numbers