Rpi4 HAL question

More
5 years 2 months ago #218071 by CatoFu
Rpi4 HAL question was created by CatoFu
Hello,

I am a beginner of LinuxCNC and trying to set up a machine with Rpi4 and prefer to use its GPIO for pulse generator just for my understanding LinuxCNC architecture.
I installed 
www.linuxcnc.org/iso/linuxcnc-2.8.1-pi4.zip
and
github.com/LinuxCNC/linuxcnc/blob/master...hal_pi_gpio_demo.hal
.
The hal_pi_gpio_demo.hal works and I confirmed each axis step pulses are generated.

In the file, there is a line that I cannot understand, which is 
loadrt hal_pi_gpio dir=78855 exclude=32918520
.
I understand loadrt hal_pi_gpio, but do not dir=78855 exclude=32918520.
Could anyone please explain what the numbers mean?

Thank you

Cato 

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

More
5 years 2 months ago #218078 by PCW
Replied by PCW on topic Rpi4 HAL question
What does the manual page for hal_pi_gpio say?

I suspect those numbers are masks that set which GPIO pins are outputs (dir)
and which GPIO setup bits to leave unchanged (excluded)

The numbers would make more sense in hexadecimal

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

More
5 years 2 months ago #218090 by elovalvo
Replied by elovalvo on topic Rpi4 HAL question

Hello,

I am a beginner of LinuxCNC and trying to set up a machine with Rpi4 and prefer to use its GPIO for pulse generator just for my understanding LinuxCNC architecture.
I installed 
www.linuxcnc.org/iso/linuxcnc-2.8.1-pi4.zip
and
github.com/LinuxCNC/linuxcnc/blob/master...hal_pi_gpio_demo.hal
.
The hal_pi_gpio_demo.hal works and I confirmed each axis step pulses are generated.

In the file, there is a line that I cannot understand, which is 
loadrt hal_pi_gpio dir=78855 exclude=32918520
.
I understand loadrt hal_pi_gpio, but do not dir=78855 exclude=32918520.
Could anyone please explain what the numbers mean?

Thank you

Cato 

Look this post
forum.linuxcnc.org/27-driver-boards/3770...erry-pi-gpios#157180

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

More
5 years 2 months ago #218140 by CatoFu
Replied by CatoFu on topic Rpi4 HAL question
Hello PCW,

Thank you for your help.

Now I understand what the number means.
As you mentioned there are some lines which commented out on the file.
It says;
# 0 0 0 0 0 0 0 0 0 1 0 0 1 1 0 1 0 0 0 0 0 0 0 1 1 1 dir mask (0 means in 1 means out) dec 78855
# 0 1 1 1 1 1 0 1 1 0 0 1 0 0 1 0 1 1 1 1 1 1 1 0 0 0 exclude mask (0 means use 1 means dont use) dec 32918520

I did not even know what the dec means and now I have leaned.

Thank you so much!
Have a good day!

Cato

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

More
5 years 2 weeks ago #223282 by diy
Replied by diy on topic Rpi4 HAL question
Write software, you can try

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

More
5 years 2 weeks ago #223283 by diy
Replied by diy on topic Rpi4 HAL question
download

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

Time to create page: 0.154 seconds
Powered by Kunena Forum