PCI Parallel Port Cards
From PROBOTIX :: wiki
Copied from linuxcnc.org forum: https://forum.linuxcnc.org/18-computer/18917-faq-pci-parallel-port-cards
PCI Parallel port cards
A PCI parport card can be used to provide extra IO very cheaply, or even enable a computer without a parport to run Linuxcnc. Dual headed (2 port) cards are very useful, especially where PCI slots are scarce.
There is an added safety net with a PCI card, shorting out the parport will not ruin the on-board port or even the whole MB.
For stepper systems the NetMOS / MosChip chipset works fine. These are the most widely used chips by card manufacturers, irrespective of what the actual card is branded as.
Try to avoid the 9805 and 9815 chips which are quite old and were a bit flakey, often difficult to set as input. The 9845, 9865 and 9901 chips (often designated MCS9845, MCS9865 and MCS9901) work fine
Other chipsets work too, described in the hardware link below.
To communicate with other EPP interfaced FPGA cards, requires a parport card that properly supports EPP. Moschip notoriously does not. The Oxsemi (PLXTech now) OX16PCI954 is recommended by one of the major manufacturers of such FPGA cards. EPP isn't needed for stepper systems as the input and output pins are in separate groups in the other modes. (see also Oxford semiconductor link at footer)
Run lspci -vv from a terminal once installed and you will get a print similar to the below for your card.
0000:01:0a.0 Communication controller: Netmos Technology PCI 9845 Multi-I/O Controller (rev 01) Subsystem: LSI Losgic / Symbios Logic 2POS (2 port parallel adapter) Flags: medium devsel, IRQ 5 I/O ports at b800 I/O ports at bc00 I/O ports at c000 I/O ports at c400 I/O ports at c800 I/O ports at cc00
This is a dual port card, some trial and error is required to establish which addresses are the ports and which the registers. Work your way through them, connecting in the hal file as below.
See link to Big JTs port tester as one option to test. Another simple option is to move a known good signal wire (from a limit switch say), from the BOB connected to existing port, to new BOB and activate the switch whilst watching the relevant pins in Hal Configuration window.
On this card, 0xc000 was the port on the card and 0xb800 the port connected via the flyer ribbon cable.
Connecting up in .hal file
The example card is connected in the .hal file thus loadrt hal_parport cfg="0x378 out 0xc000 in 0xb800 in"
0x378 being the computer port, used for stepper step/dir etc. pins 2-9 are output. 0xc000 and 0xb800 are set as input, which sets pins 2-9 as input, allowing many sensors, encoders, switches etc to be attached
The extra parports are addressed in the hal file by incrementing numbers 0x378 is parport.0, 0xc000 is parport.1 , 0xb800 is parport.2 etc.
Each extra parport needs to be attached to a thread ie. addf parport.1.read base-thread addf parport.1.write base-thread addf parport.2.read base-thread addf parport.2.write base-thread
The individual pins are addressed simply by their numbers, as per the base parport eg. net anewsignal => parport.1.pin-03.in
linuxcnc.org/docs/2.5/html/examples/pci_parallel_port.html linuxcnc.org/docs/2.5/html/hal/parallel_port.html wiki.linuxcnc.org/emcinfo.pl?EMC2_Supported_Hardware wiki.linuxcnc.org/cgi-bin/wiki.pl?NetMos www.linuxcnc.org/index.php/english/compo...iew&catid=18&id=4743 (JTs port tester)
NB If you have an Oxford Semiconductor PCI card, there is a Windoze utility to change the mode which has vanished off the web You can get it here File Attachment: File Name: oxprom.zip File Size:127 KB