Parallel port control pins less than 1V(output)

More
04 Nov 2022 13:33 #255911 by TooTall18T
Hi, I'm not sure if this is the right place for my topic. If not feel free to move it.

At the moment I'm using a Longshine PCIe two port parallel port card at my milling machine. ( www.reichelt.de/2-port-parallel-pcie-kar...tct=pos_3&nbc=1&&r=1 )
Until now I didn't use the control pins 1, 14, 16 and 17 , but now I try to get them to work as outputs.

Both parallel ports are configured as "out" (loadrt hal_parport cfg="0 out 1 out") and all pins can be used correctly but not the four control pins.
If I use them as output I can toggle them in LinuxCNC but the voltage is less than 1V . As high signal. Every time I start the computer again I get a other voltage sometimes 0,235V, sometimes 0,755V or something in between. The other outputs have 3,3V .
I also tried not to use "parport_pc" and removed it with "sudo rmmod parport_pc" and use "loadrt hal_parport cfg="0x3008 out 0x3018 out" " instead. I only got a message in LinuxCNC "No parport registered at 0x3018. This is not always an error. Continuing.", but the card can be used like the way before.
With the ptest.hal/.xml I can not toggle the control pins. They stay at 0V .

I have tried to set the parallel port to a other mode by using modprobe (spp, ecp, epp), but I can't see any changes. Is anywhere a file or a program output where I can see the actual setting of the mode?
If I change the settings in hal to "in" or "x" I can see that all pins change there function how it should be, but the control pins have still less than 1V .

Today I could test the card on Windows XP and Mach3 .
The control outputs have 1,6V that is more than on Linux but still not enough to switch the Schmidt-Trigger. And on Windows the input pins have a pull up resistor(2,4V) but not at Linux.


During my search for solutions, I saw that I'm not the only one using a card with the chipset.
I'm working at this problem some days and now I'm out of ideas.
Maybe I did something wrong and someone here can see it.

Linux linuxcnc 4.19.0-22-rt-amd64 #1 SMP PREEMPT RT Debian 4.19.260-1 (2022-09-29) x86_64 GNU/Linux


sudo lspci -vv
11:00.0 Parallel controller: MosChip Semiconductor Technology Ltd. PCI 9865 Multi-I/O Controller (prog-if 03 [IEEE1284])
    Subsystem: Device a000:2000
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 32, Cache Line Size: 32 bytes
    Interrupt: pin A routed to IRQ 16
    Region 0: I/O ports at 3008 [size=8]
    Region 1: I/O ports at 3000 [size=8]
    Region 2: Memory at dc101000 (32-bit, non-prefetchable) [size=4K]
    Region 4: Memory at dc100000 (32-bit, non-prefetchable) [size=4K]
    Capabilities: [48] Power Management version 2
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot-,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
    Kernel driver in use: parport_pc
    Kernel modules: parport_pc

11:00.2 Parallel controller: MosChip Semiconductor Technology Ltd. PCI 9865 Multi-I/O Controller (prog-if 03 [IEEE1284])
    Subsystem: Device a000:2000
    Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 32, Cache Line Size: 32 bytes
    Interrupt: pin C routed to IRQ 18
    Region 0: I/O ports at 3018 [size=8]
    Region 1: I/O ports at 3010 [size=8]
    Region 2: Memory at dc103000 (32-bit, non-prefetchable) [size=4K]
    Region 4: Memory at dc102000 (32-bit, non-prefetchable) [size=4K]
    Capabilities: [48] Power Management version 2
        Flags: PMEClk- DSI- D1- D2- AuxCurrent=375mA PME(D0+,D1-,D2-,D3hot-,D3cold+)
        Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=1 PME-
    Kernel driver in use: parport_pc
    Kernel modules: parport_pc

sudo dmesg |grep parp
[   14.304480] parport0: PC-style at 0x3008, irq 16 [PCSPP,TRISTATE,EPP]
[   14.399507] parport1: PC-style at 0x3018, irq 18 [PCSPP,TRISTATE,EPP]


cnc-para.hal
# Generated by stepconf 1.1 at Mon Apr 12 17:09:52 2021
# Änderungen an dieser Datei werden beim nächsten
# overwritten when you run stepconf again
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hal_parport cfg="0 out 1 out"
###loadrt hal_parport cfg="0x3008 out 0x3018 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
##1# loadrt or2


##1# addf or2.0 servo-thread


addf parport.0.read base-thread
addf parport.1.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread
addf parport.1.write base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
net spindle-cmd-rpm     <= spindle.0.speed-out
net spindle-cmd-rpm-abs <= spindle.0.speed-out-abs
net spindle-cmd-rps     <= spindle.0.speed-out-rps
net spindle-cmd-rps-abs <= spindle.0.speed-out-rps-abs
net spindle-at-speed    => spindle.0.at-speed
net spindle-cw <= spindle.0.forward
net coolant-mist <= iocontrol.0.coolant-mist
net coolant-flood <= iocontrol.0.coolant-flood

net probe-in => motion.probe-input
##1# net probe-in motion.probe-input <= or2.0.out


net xdir            => parport.0.pin-02-out
net xstep           => parport.0.pin-03-out
setp parport.0.pin-03-out-reset 1
setp parport.0.pin-04-out-invert 1
net ydir            => parport.0.pin-04-out
net ystep           => parport.0.pin-05-out
setp parport.0.pin-05-out-reset 1
setp parport.0.pin-06-out-invert 1
net zdir            => parport.0.pin-06-out
net zstep           => parport.0.pin-07-out
setp parport.0.pin-07-out-reset 1

net coolant-flood   => parport.1.pin-02-out
net coolant-flood   => parport.1.pin-01-out
net coolant-flood   => parport.0.pin-01-out
##net coolant-flood   => parport.1.pin-14-out
##net coolant-flood   => parport.1.pin-16-out
##net coolant-flood   => parport.1.pin-17-out

net spindle-cw      => parport.1.pin-03-out


net home-x          <= parport.0.pin-10-in
net home-y          <= parport.0.pin-11-in-not
net home-z          <= parport.0.pin-12-in-not

##1# net touchprobe-in or2.0.in0        <= parport.1.pin-10-in-not
##1# net toolprobe-in or2.0.in1        <= parport.1.pin-12-in-not
##2# net probe-in        <= parport.1.pin-12-in-not
net probe-in        <= parport.1.pin-12-in-not
net estop-ext       <= parport.1.pin-13-in-not




setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 70000
setp stepgen.0.dirsetup 70000
setp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable joint.0.amp-enable-out => stepgen.0.enable
net home-x => joint.0.home-sw-in

setp stepgen.1.position-scale [JOINT_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 70000
setp stepgen.1.dirsetup 70000
setp stepgen.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
net ypos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => joint.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable joint.1.amp-enable-out => stepgen.1.enable
net home-y => joint.1.home-sw-in

setp stepgen.2.position-scale [JOINT_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 70000
setp stepgen.2.dirsetup 70000
setp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL
net zpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable joint.2.amp-enable-out => stepgen.2.enable
net home-z => joint.2.home-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

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

More
04 Nov 2022 15:55 #255928 by tommylight
Did you measure with or without load?
Usually on my cards, those pins require more current as inputs, as outputs i had no issues ever, except the voltage is always a bit lower than other 8 outputs, 3.1 to 3.2V for a 3.3V board, and 4.3 to 4.5V for a 5V board.

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

More
04 Nov 2022 19:08 #255939 by TooTall18T
I measured it directly at the port, at the other end of the cable, with 10k pull down resistor, without the resistor and with and without the Schmit-Trigger. The voltage stays the same unless I restart the computer.

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

More
05 Nov 2022 22:43 #256037 by andypugh
Try wiring them as sinking outputs. I suspect that you can safely pull them up to 5V (because it is meant to be a parallel port, after all) and you can generally rely on a parport to sink 15mA.
I wouldn't rely in that in this case, but a pull-up sized for sinking 5mA will probably work.
The following user(s) said Thank You: TooTall18T

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

More
06 Nov 2022 10:57 #256055 by TooTall18T
Thanks andypugh it works.

Because of the 3,3V output signals I am using 3,3V on the pc side of the board.
With a 680Ohm pull up resistor a current of approx 4mA flows through the pin of the parallel port. I can measure a voltage between 0,52V and 2,9V.
I also tested it with a 1k resistor. The current is approx 3mA and the voltage switches between 0,2V and 2,8V.
In my case the parallel port triggers a Schmitt-Trigger and the 0,2V and 2,8V are clean logic levels at 3,3V supply voltage.

In my case the 10k resistor that I used as pull down before is to large as a pull up and that is the reason why it didn't work when I tested it.
The following user(s) said Thank You: joekline9

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

Time to create page: 0.092 seconds
Powered by Kunena Forum