Using a parport in 'X' mode.
02 Mar 2017 16:21 #88885
by Elco
Using a parport in 'X' mode. was created by Elco
I am fairly new to LinuxCNC, but have configured and ran a simple system (3 axis, only Estop and home signals). I am now trying to add probe and an MPG, by setting the parallel port in 'x' mode to create 9 inputs and 8 outputs. The card seems to have Open Collector outputs.
Is it correct that this setup cannot be configured with the setup Wizard (as it does not allow the - now input - pins to be configured with the right signals?
I followed the description for the Parport setup in the HAL manual. My assumption is that in 'X' mode the control group (pins 1, 14, 16 and 17) changes from output to input, as mentioned at the end of 10.1.2 Pins of the HAL manual (however it says "pins 1, 14, 16 and 17 are outputs in all modes" a few lines above).
It is testing the setup where I have a problem. Not running a configuration, I can start HAL with 'halrun' from the command prompt OK, load hal_parport in X mode, and list the port pins. The listing is ambiguous, for instance for port 1 it shows Direction as OUT, but creates both parport.0.pin-01-in and parport.0.pin-01-in-not. And both have value FALSE(?)
When I try to start the base-thread to read and write the port with addf parport, hal reports that the base-thread is not found.
What do I do wrong here?
Thanks for your help,
Elco
Is it correct that this setup cannot be configured with the setup Wizard (as it does not allow the - now input - pins to be configured with the right signals?
I followed the description for the Parport setup in the HAL manual. My assumption is that in 'X' mode the control group (pins 1, 14, 16 and 17) changes from output to input, as mentioned at the end of 10.1.2 Pins of the HAL manual (however it says "pins 1, 14, 16 and 17 are outputs in all modes" a few lines above).
It is testing the setup where I have a problem. Not running a configuration, I can start HAL with 'halrun' from the command prompt OK, load hal_parport in X mode, and list the port pins. The listing is ambiguous, for instance for port 1 it shows Direction as OUT, but creates both parport.0.pin-01-in and parport.0.pin-01-in-not. And both have value FALSE(?)
When I try to start the base-thread to read and write the port with addf parport, hal reports that the base-thread is not found.
What do I do wrong here?
Thanks for your help,
Elco
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
02 Mar 2017 17:34 #88891
by Todd Zuercher
Replied by Todd Zuercher on topic Using a parport in 'X' mode.
I have a couple of machines that use X-mode. A port will usually have to be configured for SPP mode in order to work with X-mode. X-mode will not work on a port configured for EPP.
Yes, Stepconfig is not set up to use X-mode. Probably the simplest solution is to setup the port as "out" then manually configure pins 1, 14, 16, and 17 and change the loadrt hal_parport cfg="0 out" line to loadrt hal_parport cfg="0 X" in your hal file with a text editor.
The line in the manual you are looking at that says "pins 1, 14, 16 and 17 are outputs in all modes" is wrong and was written before X-mode existed. What version of Linuxcnc are you using, and for what version of Linuxcnc is the manual you were looking at for? (I thought that error was corrected in the current version of the docs.)
The state off both the pins parport.0.pin-01-in and parport.0.pin-01-in-not should not be the same, one should always be true and the other false. But it is correct that they should both be direction OUT pins. It is a little confusing that parallel port in pins are hal out pins. Just remember the parallel port pin in receives a signal into the port but sends that signal out into hal.
Did you configure a Base thread in Stepconfig? Post copies of your ini and hal files and we can point out where your mistakes are.
Yes, Stepconfig is not set up to use X-mode. Probably the simplest solution is to setup the port as "out" then manually configure pins 1, 14, 16, and 17 and change the loadrt hal_parport cfg="0 out" line to loadrt hal_parport cfg="0 X" in your hal file with a text editor.
The line in the manual you are looking at that says "pins 1, 14, 16 and 17 are outputs in all modes" is wrong and was written before X-mode existed. What version of Linuxcnc are you using, and for what version of Linuxcnc is the manual you were looking at for? (I thought that error was corrected in the current version of the docs.)
The state off both the pins parport.0.pin-01-in and parport.0.pin-01-in-not should not be the same, one should always be true and the other false. But it is correct that they should both be direction OUT pins. It is a little confusing that parallel port in pins are hal out pins. Just remember the parallel port pin in receives a signal into the port but sends that signal out into hal.
Did you configure a Base thread in Stepconfig? Post copies of your ini and hal files and we can point out where your mistakes are.
The following user(s) said Thank You: Elco
Please Log in or Create an account to join the conversation.
03 Mar 2017 11:09 #88920
by Elco
Replied by Elco on topic Using a parport in 'X' mode.
Todd,
Thanks for your advice. I have not hooked it up to the hardware yet, but using the hal meter, and measuring the signals on the DB-25 connector, it seems to work OK. To get there, I first generated with the wizard a two port configuration, which I consolidated in one; attached is the current HAL file. I still need to setup the connections to the (home built) MPG.
The HAL manual I used is V2.6.13, but the paragraph about "pins 1, 14, 16 and 17 are outputs in all modes" is copied many documents I found on the web. An update would be useful.
Thanks again,
Elco
Thanks for your advice. I have not hooked it up to the hardware yet, but using the hal meter, and measuring the signals on the DB-25 connector, it seems to work OK. To get there, I first generated with the wizard a two port configuration, which I consolidated in one; attached is the current HAL file. I still need to setup the connections to the (home built) MPG.
The HAL manual I used is V2.6.13, but the paragraph about "pins 1, 14, 16 and 17 are outputs in all modes" is copied many documents I found on the web. An update would be useful.
Thanks again,
Elco
Please Log in or Create an account to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
Less
More
- Posts: 5007
- Thank you received: 1441
03 Mar 2017 13:35 #88926
by Todd Zuercher
Replied by Todd Zuercher on topic Using a parport in 'X' mode.
The manual corrections reguarding X-mode and the parallel port driver are only in versions 2.7 and later, even though X-mode has existed since version 2.1. Very few people that I am aware of actually use it. And no off the shelf breakout boards support X-mode's pinout. Googling "Linuxcnc Parport" brings up many older versions of the documentation and the current docs never seem to be at the top of the list,
Please Log in or Create an account to join the conversation.
- tommylight
- Away
- Moderator
Less
More
- Posts: 19188
- Thank you received: 6432
03 Mar 2017 14:53 #88930
by tommylight
Replied by tommylight on topic Using a parport in 'X' mode.
I use X mode for testing very offten, never had problems with it, except they require a bit more current to work than the usual inputs, some encoders will not work with it, some do fine.
The following user(s) said Thank You: Elco
Please Log in or Create an account to join the conversation.
Time to create page: 0.123 seconds