PI-LCNC Project

  • tuzki
  • tuzki's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
28 Nov 2021 03:38 #227796 by tuzki
PI-LCNC Project was created by tuzki
hello everyone

I found a project about raspberry pie on "GitHub", which allows raspberry pie to connect to the parallel port control board to control CNC.

This is the website of the project:
github.com/ChrisWag91/PI-LCNC

Thank Chris wag91 for his dedication. But I also have a lot of doubts about this project
 
This is a test system。

I have a big question about the GPIO components of raspberry pi
I enter in the terminal: 
      loadrt hal_ pi_ gpio
      show all hal_pi_gpio

Why are the pins displayed in the terminal different from those displayed in "linuxcnc Hal configuration"
 
 
Attachments:

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

  • tuzki
  • tuzki's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
28 Nov 2021 04:36 #227797 by tuzki
Replied by tuzki on topic PI-LCNC Project
I want to use pin 11 of the parallel port control board. I see that pin 11 of the parallel port control board is connected to pin 23 of raspberry pi. I tried to change my ". HAL" file, but I got an error

 
 
Attachments:

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

More
28 Nov 2021 08:48 #227803 by tjtr33
Replied by tjtr33 on topic PI-LCNC Project
Hello

they are not different
on left it says
hal_pi_gpio,pin-03-out
on right it says
hal_pi_gpio
|_ pin-03-out

it is same name, just formatted 2 ways,
1) as a full name
Fred Flintstone
2) versus family name, given name
Flintstone
|_ Fred

hth TomP

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

More
28 Nov 2021 09:02 #227804 by tjtr33
Replied by tjtr33 on topic PI-LCNC Project
Hello
maybe this will help...

please take care,
gpio pin numbers
are not
raspberry pi header pin numbers

---from the hal_pi_gpio.c file----
// elinux.org/index.php?title=RPi_Low-level...herals&printable=yes
// Rev 1 Raspberry:
static unsigned char rev1_gpios[] = {0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25};
static unsigned char rev1_pins[] = {3, 5, 7, 26, 24, 21, 19, 23, 8, 10, 11, 12, 13, 15, 16, 18, 22};

// Rev2 Raspberry:
static unsigned char rev2_gpios[] = {2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27};
static unsigned char rev2_pins[] = {3, 5, 7, 26, 24, 21, 19, 23, 8, 10, 11, 12, 15, 16, 18, 22, 13};

// Raspberry2/3:
static unsigned char rpi2_gpios[] = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 };
static unsigned char rpi2_pins[] = {3, 5, 7, 29, 31, 26, 24, 21, 19, 23, 32, 33, 8, 10, 36, 11, 12, 35, 38, 40, 15, 16, 18, 22, 37, 13 };

for the raspberry pi you are using ( one of 3 sets above)
the upper line is the gpio number
the lower line is the rpi header pin

so try Halrun
and use setp to turn on and off gpio pins
and a voltmenter to see where the rpi pin is

i wrote a different driver that only uses rpi header pin number
because thats the thing i can probe and connect to
It wasnt popular ;-/

HTH tomp

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

  • tuzki
  • tuzki's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
28 Nov 2021 16:01 #227817 by tuzki
Replied by tuzki on topic PI-LCNC Project
Thank you for your answer. I think I should learn something about raspberry pi (~ ̄▽ ̄)~(~ ̄▽ ̄)~

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

  • tuzki
  • tuzki's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
29 Nov 2021 17:28 #227929 by tuzki
Replied by tuzki on topic PI-LCNC Project

Hello
maybe this will help...

please take care,
gpio pin numbers
are not
raspberry pi header pin numbers

---from the hal_pi_gpio.c file----
// elinux.org/index.php?title=RPi_Low-level...herals&printable=yes
// Rev 1 Raspberry:
static unsigned char rev1_gpios = {0, 1, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 21, 22, 23, 24, 25};
static unsigned char rev1_pins = {3, 5, 7, 26, 24, 21, 19, 23, 8, 10, 11, 12, 13, 15, 16, 18, 22};

// Rev2 Raspberry:
static unsigned char rev2_gpios = {2, 3, 4, 7, 8, 9, 10, 11, 14, 15, 17, 18, 22, 23, 24, 25, 27};
static unsigned char rev2_pins = {3, 5, 7, 26, 24, 21, 19, 23, 8, 10, 11, 12, 15, 16, 18, 22, 13};

// Raspberry2/3:
static unsigned char rpi2_gpios = {2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27 };
static unsigned char rpi2_pins = {3, 5, 7, 29, 31, 26, 24, 21, 19, 23, 32, 33, 8, 10, 36, 11, 12, 35, 38, 40, 15, 16, 18, 22, 37, 13 };

for the raspberry pi you are using ( one of 3 sets above)
the upper line is the gpio number
the lower line is the rpi header pin

so try Halrun
and use setp to turn on and off gpio pins
and a voltmenter to see where the rpi pin is

i wrote a different driver that only uses rpi header pin number
because thats the thing i can probe and connect to
It wasnt popular ;-/

HTH tomp


 

I typed "show hal_pi_gpio" in the terminal, and the terminal printed out many GPIO pins.

I use "setp hal_pi_gpio.pin-40-out 1" to control the pin output, but nothing happens, and the pin voltage is still 0V.

I think the GPIO pin printed out by the terminal is the number of the Raspberry Pi header. I did not forget to enter "halcmd start", but nothing happens to the Raspberry Pi pins.

I don't know why.`(*>﹏<*)′`(*>﹏<*)′

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

  • tuzki
  • tuzki's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
More
29 Nov 2021 17:33 #227930 by tuzki
Replied by tuzki on topic PI-LCNC Project
My English is not good, please forgive me. The same thing has different names in Chinese and English, so I often cause confusion when using translation software.

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

More
09 Dec 2022 23:07 #259048 by KTECH
Replied by KTECH on topic PI-LCNC Project
Hello,
I have exactly the same problem and I am wondering if you have solved this problem ?
it would help me a lot.
thank you

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

Time to create page: 0.126 seconds
Powered by Kunena Forum