Parallel Port Card CH352 Chip

20 Feb 2014 08:27 #43992 by Engineer Dwayne
Adding a Second Parallel port CH352 to Ubuntu and Linux CNC

I have been reading and trying stuff for three weeks now and am it wits end.

I have an older dell computer with the integrated parallel port at address 0x378. I want to add a second parallel port to work towards a voltage controlled torch height controller. My machine was working on the existing parallel port rather predictably.

I bought the deal extreme pci parallel port which has come to be know as the CH352 card. It has a single chip, likely some type of programmable ic which made it very inexpensive. Showed up quickly, fit right in, looking good.

After trying every address that I could find for the second parallel port in stepconf nothing worked.

At the terminal prompt, using Desktop Applications Accessories Terminal I could run the lspci -v command.

Holy, that looks nothing like the examples on the web.
Lots of devices were access denied, and there were usb devices, graphics devices, sound devices, serial devices, I got three pages of devices, none of which seemed to say anything about a parallel port.

Back to the net, and after removing the card and running lspci – v, inserting the card and running lspci –v and deductively seeing what was different, I was able to narrow it down to three devices that changed when I added 1 card.

First was

00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev81) . . .
Memory behind bridge ff800000-ff9fffff
Prefetchable memory behind bridge fff00000 – 000fffff …..

The second

00:1f.0 ISA bridge …..

And the third,

a serial card 01:07:0 Serial Controller; Device 4348:5053 (rev 10)(prog-if 02)
Subsystem: Device 4348:5053 …..
Region 0:I/O ports at ecf8 [size 8]
Region 1:I/O ports at ece8 [size 8]
Kernel driver in use: serial

Okay, stumped. Now what?

Turns out that there is a disk included with the card with “drivers” for Linux and Windoughs
The instructions are extremely short and read:
. . . .
3 – install and uninstall CH352 PCI to one paraport
(1) Install
<1>-copy install_p_80x86.o to /usr/sbin
<2>-Add /usr/sbin/install_p_80x86 at the end of the /etc/rc.d/rc.local.
The LP1 and LP2 (if you inster two boards) are ready for application.
(2) Uninstall . . . . .

So I think I need to save a “driver file” somewhere and get the program to execute the driver file on startup.

I discovered that you cannot do this copy and paste from the Ubuntu desktop. I could copy the file install_p_80x86.o from the CD to the desktop but trying to copy it into any of the many /usr/sbin directories was not permissible due to the owner of the folder being “root”. WTF?

I read a whole bunch of fairly cryptic webpages and have come to believe that I can only copy this file using the Desktop Applications Accessories Terminal; enter at the top left of the GUI which provides a prompt.

A command called “sudo” then lies to the operating system about my permission level and ownership. Why? I don’t know, it’s my machine in my garage and I am the sole user, admin, installer. Who the heck is this “root” guy and why is he on my computer? I feel like a hacker-burgler in my own computer.

So at the prompt, after searching on the web how to’s and on the Ubuntu file structure I write:

duane@duane-desktop:/usr/sbin$ sudo cp /home/duane/Desktop/install_p_86x80.o /usr/sbin/install_p_80x86

and low and behold, the file copies into /usr/sbin

Okay, now to add the executable line into rc.local. The instructions with the card kind of make sense now, once I sort of understand what I think they want me to do. But I had to search all over the net to find what to do next. And, by the way, I still can’t find this rc.d directory, only rc0.d, rc1.d, rc2.d etc up to 6.

Another search and forum suggested that using rc.local in the directory /etc was really what needed to be done.

So again the root guy owns this too, so using any sort of point and click editor is prohibited and it’s back to the terminal to gedit, rc.local.
rc.local is entirely commented out. # at the beginning of every line.

The comments say the rc.local file does nothing

So I remove the # on the first line and the 0 exit line at the end, and add the line /usr/sbin/install_p_86x80

I assume I don’t need the .o extension, or at least that’s what the instructions(?) with the card say.

Okay, do that, reboot, start up stepconf, add the 0xece8 for the second paraport and save. Start up CNC and CRASH. The errors come up as can’t allocate paraport 0 at 0x378, nevermind the new one at 0xece8.

Wend back to an old stepconf and the 0x378 only setup no longer works.

So, new questions, did this install_p_86x80.o mess up parallel port 0 which was working fine?

Seems to have.

I have also found reference to modifying a script file: The explaination(?) goes something like this:

cd /lib/modules/2.4.20-8/kernel/drivers/char
rmmod lp
cd /lib/modules/2.4.20-8/kernel/drivers/paraport
rmmod parport.pc
insmod parport_pc.o io=0x378,0xdf38 //parport I/O base address
cd /lib/modules/2.4.20-8/kernel/drivers/char
insmod lp.o

Well, I recognize the #!/bin/sh. That was at the top of the local.rc file. BTW I took out the # thinking it was a comment in front of !/bin/sh. Should I have? I only added

/usr/sbin/install_p_80x86 and the "0" at the end cause that what the instructions said. Well actually the local.rc file said have a exit 0 at the end.

Now nothing works, CNC program CRASHES looking for parallel port 0.

Why is this so difficult!

As a suggestion, wouldn’t it make sense if one selected a second parallel port in stepconf, that a second pin assignment page automatically come up?

I don’t even want to think about HAL and the Ladder Logic that is coming up if I ever get this card to work.

What have I missed?
Do I leave the # characters in or take them out?
is exit 0 the right thing at the end of the file or # exit 0?
don't I eventually set the addresses in a hal config line? Whats this insmod rmmod stuff about?

Thanks for reading.

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

20 Feb 2014 12:09 #43997 by PCW
Replied by PCW on topic Parallel Port Card CH352 Chip
In general you _DO NOT_ want to install any supplied drivers with parallel port cards

did you try stepconf with the 0xECF8 and 0xECE8 addresses?

one is likely to be the PCI parallel port address

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

20 Feb 2014 17:27 - 20 Feb 2014 17:31 #44001 by ArcEye

Unfortunately you have chosen a very flakey card, whose parallel port is only usable with a driver.
The 2 addresses you have on the print are what they say they are, serial ports. A lot of parport cards also provide a couple of serial ports too.

This is how to get the driver working

However this will not work with Linuxcnc, because as PCW says, if you use a driver which claims the port or invokes another module which does, in this case parport_pc,
Linuxcnc will not be able to claim the port and your config will fail.

If you are using steppers and software generated steps, get a parport card which is based upon the MosChip 9845 or higher chip.

If using a FPGA card or Gecko drivers which require EPP mode to work, Oxford semiconductors are a good choice

See my FAQ

Time to cut your losses, put it back on ebay and buy one suited to the task

Last edit: 20 Feb 2014 17:31 by ArcEye.
The following user(s) said Thank You: Engineer Dwayne

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

22 Feb 2014 06:15 #44054 by Engineer Dwayne
Sigh. I guess I will go shopping again. Are there any wonderful i/o cards available that are inexpensive and offer advantages that are not obvious? The whole parallel port thing seems to be "making the best use of what you have available" Lots of inverted signals and things. I haven't had much luck with the whole charge pump concept either.

Thanks for your help.

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

22 Feb 2014 10:06 #44058 by Todd Zuercher
I'll put in my vote for Mesa's 5i25. It can do the job of 2 parallel ports, or much much more (if you add any of the optional daughter cards). And for only $89 is quite the bargain.

But if you have your heart set on a parallel port card, start with this FAQ to help you choose a usable one.

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

22 Feb 2014 20:29 - 22 Feb 2014 20:31 #44068 by ArcEye
Parports are simple and cheap and work very well with a low latency computer, thats why so many people still use them.
An IO card will give you advantages, at a price.

I haven't had much luck with the whole charge pump concept either.

If you mean that you can't get the machine to come out of Estop and activate the charge pump, that will be quite simple to fix.
Stepconf used to produce a config that did not work with some charge pump activated BOBs

You will have to be specific about the problem and attach your hal and ini files

Last edit: 22 Feb 2014 20:31 by ArcEye.

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

12 Mar 2014 01:41 #44688 by Engineer Dwayne
Hi again. Just some follow up findings. Yes I purchased a second parallel port card with a known chipset and have had much better results. The lspci -v command gave sensible results and putting the base address into stepconf worked, both as an input or as an output card.

Having a know chipset card meant there were no drivers that needed to be installed, even though a disk came with the card.

I can use the hal viewer in axis and successfully "see" all the pin inputs. haven't tested the outputs, other than to see that they light up led's and turn them off during the boot process, so I have no concern that they are working. I am going to start two new threads with a couple of issues. Thanks everyone.

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

15 Jul 2014 14:44 - 15 Jul 2014 14:45 #48799 by vre
Replied by vre on topic Parallel Port Card CH352 Chip
I have a similar card

$ lspci -v
01:05.0 Serial controller: Device 4651:5073 (rev 10) (prog-if 02 [16550])
Subsystem: Device 4651:3273
Flags: medium devsel, IRQ 20
I/O ports at e030
I/O ports at e020
I/O ports at e010
I/O ports at e000
Kernel driver in use: serial

I have created this file

$ cat /etc/modprobe.d/parport_CH352L.conf
options parport_pc io=0xe010

and with this command loaded the driver

# modprobe parport_pc

after that output from dmesg

[ 166.771940] parport0: PC-style at 0xe010, irq -2147483648 [PCSPP,TRISTATE]
[ 166.771972] parport0: irq -2147483648 in use, resorting to polled operation

Can this card working with linuxcnc now ?
Last edit: 15 Jul 2014 14:45 by vre.

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

Time to create page: 0.199 seconds
Powered by Kunena Forum