Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can pi-parport work with linuxcnc? #19

Open
masterzion opened this issue Feb 26, 2019 · 10 comments
Open

can pi-parport work with linuxcnc? #19

masterzion opened this issue Feb 26, 2019 · 10 comments

Comments

@masterzion
Copy link

Hi,
I have a doubt about this lib. I am not sure if it is a issue.

I after build and run, it seems it works.
I tested whit this Diagnostic Utility.
http://yyao.ca/projects/ParallelPortLinux/

But, it seems I must to declare the DMA address to make it work with Linux CNC
image

I could not find the address on the documentation and it seems the 0x378 is not recognized by hal_parport.

Is it possible to set some address?
The default linux parport_pc allow us to set it by parameter.
ex:
insmod parport_pc io=0x3b

Regards

@garlick
Copy link
Collaborator

garlick commented Feb 26, 2019 via email

@garlick
Copy link
Collaborator

garlick commented Apr 25, 2019

There was a way to tell the PC DMA controller to move data through the parallel port in ECP mode, but looking at your issue in more detail, I think linuxcnc just wants to bit bang the legacy x86 memory mapped I/O ports.

That won't work here. If one wants to bit bang the port pins, one would need to go through the parport driver stack using ppdev, described here:

https://people.redhat.com/twaugh/parport/html/ppdev.html

I don't know if the additional latency of the ppdev method is prohibitive for this use case, but since apparently there is a hardware abstraction layer (HAL?) it might be reasonable to try to create a driver that uses ppdev, or perhaps one that allows you to more directly access arbitrary GPIO pins?

I'll retitle this issue to be more specific to linuxcnc, since it's a compelling use case if it could work!

@garlick garlick changed the title DMA can pi-parport work with linuxcnc? Apr 25, 2019
@andrewtubbiolo
Copy link

andrewtubbiolo commented Apr 25, 2019 via email

@Dloranger
Copy link

I am interested in using this for linux CNC as well, has anyone gotten this to work?

@garlick
Copy link
Collaborator

garlick commented Dec 10, 2020

Not that I'm aware of.

@vonj
Copy link

vonj commented Dec 10, 2020

Sounds plausible that it should work, actually.

@vspositron
Copy link

Hi Everyone,

I am eagerly waiting for an RPI hat that will enable me to connect with the cheap LinuxCNC/ Mach3 CNC boards available in the market (https://in.pinterest.com/pin/720013059148220267/). It will be a holy grail for the DIY community. Please include this capability in the next version. I also appreciate all the efforts you and the team have taken so far on this project.

Thanks,
Sagar

@garlick
Copy link
Collaborator

garlick commented Dec 29, 2020

Maybe it could work now if, instead of using ppdev + the kernel parport stack, libbcm2835 is used to memory map the Pi's GPIO peripheral where it can be directly poked from user space.

That would be kind of like directly accessing the legacy parallel port on an x86 using its I/O address, which apparently works for linuxcnc.

I don't follow linuxcnc, but maybe someone has already tried this approach?

@garlick
Copy link
Collaborator

garlick commented Dec 29, 2020

@garlick
Copy link
Collaborator

garlick commented Dec 31, 2020

There is also this:

https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/drivers/hal_pi_gpio_demo.hal

which shows that the gpio pin assignment is configurable. Hmm, I don't know if the hal driver for the parport does any other magic to make those parallel port stepper boards work, but it may be as simple as replicating the above example with the correct list of GPIO pin numbers for our board + parallel port stepper board?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants