Reading FPGA data through PC parallel port status pins

Question & Answer

Classification:

Date: Sep 01, 1999

Reading FPGA data through PC parallel port status pins

Q:

The C source code of the 'xsport' utility shows an example of how to manipulate the output pins of the PC parallel port (data from PC to XS40). Are there any similar examples that show how to use the parallel port status pins for input back to the PC (data from XS40 to PC)?

A:

The pport.cpp file contains a routine called GetStatus() which will return the values on the 5 status pins of the parallel port. The call

     int s  = GetStatus()

will return the status bits in positions 3, 4, 5, 6, and 7 of s (bit 0 is the least-significant bit). (You can get the pport.cpp file in this archive and the documentation is here.)

You can have the FPGA place logic values on the status pins and then use GetStatus to read them into the PC. Look at /prgmdl40.html to see which pins on the XC4000 FPGA are connected to the parallel port status pins.