Actions

PCI Parallel Port Cards

From PROBOTIX :: wiki

Revision as of 02:53, 25 November 2019 by Admin (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

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.

EPP mode

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)

Installing


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

Links:

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)



For LinuxCNC versions before 2.7.8 (March 14, 2017), the PPMC driver always forces the port direction change. That does not work with PCIe parallel ports made by Startech, SIIG and Rosewil using the Oxford OXPCIe952 chip. PCI cards known to work with LinuxCNC < 2.7.8 :

SIIG CyberPro with Oxford OX9162 chip ITE8875 chip PCIe cards known to work: Syba SD-PEX1005 with either MCS9900 or MCS9901 chips For linuxCNC versions 2.7.8 and later, there is an option on the command line that installs the driver to select whether to force the direction change or not. By default, the driver does NOT force the direction change. To make it force the direction change, add the following text to the command line :

epp_dir=1

The command will be in the file ppmc_load.hal, univstep_load.hal, or univpwm_load.hal, depending on the configuration you are using. It will be of the form :

loadrt hal_ppmc

possibly with additional parameters at the end. Edit it to look like :

loadrt hal_ppmc epp_dir=1

PCI cards known to work with LinuxCNC >= 2.7.8

SIIG CyberPro with Oxford OX9162 chip ITE8875 chip (may not work on some HP motherboards) NetMos MCS9865IV-AA needs epp_dir=1 option NetMos MCS9835 needs epp_dir=1 option PCIe cards known to work with LinuxCNC >= 2.7.8

Syba SD-PEX1005 PCI cards that do not work with any version :

NetMos MCS9805 chip

PCIe cards that do not work with any version :

WCH CH382L chip