A Treatsie on the Parallel Port

More
23 Jun 2024 07:23 #303614 by cornholio
Regarding PCI or PCIe Parallel Port Cards.
1: Forget about manufacturers' supplied drivers. They all usually for old kernels, modern kernels have them just about all covered. And to tell the truth there is only a handful of chipsets used. Trying to build these drivers have sent many mad, it's not worth the effort or heartache it brings. Poking a stick in ones eye is more productive (and please don't do this either).
2: To tell the truth the only interaction Linuxcnc has with a parallel Port kernel driver is to get exclusive use of it. After that Linuxcnc code takes over. Anyway does anyone have any Parallel Port devices (printers, scanners, EEPROM programmers or the like) and it's not as if you can connect them at the same time. Yes yes CUPS or the like can try and use the port but who's trying to print when making chips ?.
3: There is 3 commands that are going to let you know that the Linux kernel has found your Parallel Port.
sudo lspci
sudo cat /proc/ioports
sudo dmesg | grep parport
All these will give you info regarding the parallel port.

Running the first command on my machine returns the following and identifies as being a combo card. the first command can also have a
-v
option that gives more detail. The output of this has being truncated so you get an idea of what you are looking for.
06:0d.0 Serial controller: WCH.CN CH352 PCI Serial and Parallel Port Controller (rev 10)

The second, having a Serial port at 0x3008-0x300F and Parallel port at 0x3000-0x3002, as before the output has been truncated.
   3000-3007 : 0000:06:0d.0
      3000-3002 : parport0
    3008-300f : 0000:06:0d.0
      3008-300f : serial

The third command not truncated gives you the address (0x3000) you use in your HAL file.
[    9.435065] parport0: PC-style at 0x3000, irq 22 [PCSPP,TRISTATE]

Of course the value you get at your site will be different, but this should be enough to get 99% of Parallel Ports working.

Notes relating to on board ports.
1: Either grab a user manual for your machine or open it up and look at the MB the header might just be there.
2: I know for a fact that Lenovo machines require a special parallel port header cable (there's some trickery involved within the cable that tells the BIOS to enable the parallel port itself and the BIOS page for setting it up, I'm saying this from experience).
3: There might be some other corporate machines similar, and the cables can be found and the on board port is usually easier to setup with Linuxcnc.

Testing, or Just Don't Connect Everything Up And Expect it To Work.
This is a great resource.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Parallel_Port_Tester
Look at it, use it and browse the code, it gives an example of basic HAL & INI if you want to give it a go.

Other notes:
For Crying Out Loud do not connect anything greater than 5v to your Port, over 5v and the Genies That Operate the smoke valves will open them. The smoke you may not see, but the smell will burn and will not be forgotten.

 
The following user(s) said Thank You: tommylight, ErrickW

Please Log in or Create an account to join the conversation.

More
23 Jun 2024 08:39 #303622 by tommylight
I know of exactly 1 instance where drivers worked, on this forum. Plenty that did not work.
HP, Dell, Fujitsu, do not require a special cable/connector, but some HP will have a smaller header on board, not the standard IDC26. They do usually come with the port installed.
If applied over 5V, the built in parallel ports do not smoke and do not smell, that output remains high allways, that is with 12V. Never had an add on board go through this, so no idea how it ends up.
I like parallel ports :)

Please Log in or Create an account to join the conversation.

More
23 Jun 2024 10:55 #303634 by cornholio
Oh yeah Parallel Ports can be fun, need a quick & dirty logic analyser, actually a quick & dirty anything, is where plain old DOS was good, no hoops & stuff to jump thru. Only tricky bit with linux is to get the correct permissions as we don't wanna do stuff as root.
High enough voltage and you'll get the lovely smell acrid smell of smoked semis. Used to repair boards that operated a mechanical receipt printer......Twas a lovely smell to go with the first coffee of the day.

Like I should have said about 99% don't require the drivers, there's always going to be an exception to the rule.

One thing I forgot to mention is that some cards will come up as with ports disabled, read the other day a simple cat\echo command can fix that, tho can't confirm, tho it's gunna take a bit of time to find the reference.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
23 Jun 2024 11:18 #303636 by tommylight
The only add on cards that do not work with LinuxCNC are the "software emulated" ones, usually if they do not come with Linux drivers = do not buy them. Although hard to tell in the era of e-comerce where "everything works with arduino" despite some of it absolutely having nothing to do with arduino.

Please Log in or Create an account to join the conversation.

More
23 Jun 2024 13:57 #303643 by cornholio
You and Rod have both mentioned these software emulated cards, for the life of me I can’t find an example.
Are these similar to the “winmodems” of the 90s ?

Please Log in or Create an account to join the conversation.

More
23 Jun 2024 15:33 #303645 by tommylight
Yes they are, but worse as this/we need direct hardware access.
Look for boards with very small chips, so far that is what i noticed, they seem to be the same thing as USB>parallel.

Please Log in or Create an account to join the conversation.

More
01 Jul 2024 13:22 #304152 by hpmax
I'm a bit (or more than a bit) flumoxed at this point. I'm running a Dell Inspiron 3668 with a StarTech PCIe Parallel port card (AX99100x chip). I seem to be getting decent latency, but it doesn't appear to be working within the software. If I don't load the driver it complains that there doesn't seem to be a parallel port there, if I do load the driver:

sudo insmod parport_pc.ko io=0xd010 io_hi=0xd000 irq=14

then the error that no port there goes away (sort of). I have to sudo rmmod parport_pc.ko and then re-insmod it after each reboot. However, it still doesn't actually appear to be twiddling the bits on the parallel port, more disturbingly dmesg comes up with the following:

"parport_pc: loading out-of-tree module taints kernel."
"parport_pc: module verification failed: signature and/or required key missing - tainting kernel"
"parport 0xd010 (WARNING): CTR wrote 0x0c, read 0xff"
"parport 0xd010 (WARNING): DATA: wrote 0xaa, read 0xff"
"parport 0xd010: You gave this address, but there is probably no parallel port here!

So it really looks like I'm giving it the wrong address when loading the module, but they tell you to do an lspci -vv and it reports IRQ14 and gives two addresses 0xd000 and 0xd010. I've tried both combinations to no avail

Please Log in or Create an account to join the conversation.

More
01 Jul 2024 14:07 #304156 by cornholio
You really need to give the output of the 3 commands at the beginning of this thread.
Please do it before loading the kernel module.
The lspci one is quite important as that will show the Vendor & Product ID. Once I have this I can check if the vanilla kernel module already supports your card. The result will give an indication of what is the correct address.
Unlike Windows with Linux it is very rare to find a consumer hardware device that does not already have a supporting kernel module.

Actually since you have already installed the kernel module it may be best to boot from a live session from your installation media so we are starting a the beginning.

Please Log in or Create an account to join the conversation.

More
01 Jul 2024 14:20 - 01 Jul 2024 14:21 #304158 by cornholio
After having a bit of a search the readme also states this.

Steps for setting parallel port :


method 1(default):
1. rmmod lp
2. rmmod parport_pc
2. insmod parport_pc.ko io=bar0 io_hi=bar1 irq=number.
ex: insmod parport_pc.ko io=0xd010 io_hi=0xd000 irq=11
3. modprobe lp
Note: Here, the io, io_hi and irq should be noted from lspci -vv.
 


modprobe lp can be leftout.
Last edit: 01 Jul 2024 14:21 by cornholio.

Please Log in or Create an account to join the conversation.

More
01 Jul 2024 14:49 #304163 by hpmax
From a live session:

sudo lspci -v:

03:00.2 Parallel Controller: Asix Elecronics Corporation AX99100 PCIe to Multi I/O Conroller (prog-1f 03 [IEEE 1284])
Subsytem: Asix Electronics Corporation (Wrong ID) Parallel Port
Flags: bus master, fas, devsel, latency 0, IRQ 14 IMMU group 11
I/O ports a d010
I/O ports a d000
Memory at df101000 (32-bit, non-prefetchable) [size=4K]
Memory at df000000 (32-bit, non-prefetachable) [size=4K]
Capabilities: [50] MSI: Enable- Count 1/8 Maskable- 64 bit+
Capabilities: [78] Power Management Version 3
Capabilities: [80] Express Legacy Endpoint, MSI 00
Capabilities: [100] Advanced Error Reporting

sudo cat /proc/ioports gives:
(nothing about the pallel port but does list the following):
d000-dfff: PCI Bus 0000:03
d000-d007 : 0000:03:00.2
d010-d017 : 0000:03:00.2
d020-d027 : 0000:03:00.0
e000-efff: PCI Bus 0000:02
e0000-e0ff : 0000:02:00.0

sudo dmesg gives nothing related whatsoever

Please Log in or Create an account to join the conversation.

Time to create page: 0.106 seconds
Powered by Kunena Forum