|
|
|||
Question & AnswerClassification: Date: Sep 01, 1999 |
Reading FPGA data through PC parallel port status pinsQ: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
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 at http://www.xess.com/xstools-source-3_0.zip and the documentation from http://www.xess.com/xstools-src-doc-3_0.pdf.) You can have the FPGA place logic values on the status pins and then use GetStatus to read them into the PC. Look at http://www.xess.com/prgmdl40.html to see which pins on the XC4000 FPGA are connected to the parallel port status pins.
|
||