- Posts: 4
- Thank you received: 0
Raspberry Pi
- differentiable
- Topic Author
- Offline
- New Member
-
Less
More
4 years 5 months ago #244185
by differentiable
Raspberry Pi was created by differentiable
Yes, its another Raspberry Pi question.
Actually, its more of a "how is the project organized, where things are built and why?"
I've found a "hal_pi_gpio.c" in /src/hal/drivers.
However, the main application makes no attempt to use GPIO pins, whining about the absence of a parallel port.
Stepconf does not produce any signals on the related pins when testing.
What pin numbering scheme is actually used here?
I would like to avoid resurrecting a dinosaur with a parallel port.
I'm trying to figure out where to add support for a custom serial protocol that would satisfy my needs.
So, what did "hal_pi_gpio.c" do? Where did its binary go?
There are no options to use PI GPIO pins, despite the application having been built natively on a Pi 4 (yes, with PREEMPT RT).
The UART is just as fast as any serial port, and any parallel port adapter will be based on shifting bits into registers just to line things up with the parallel port pins. I might as well pipe that into an Arduino (or ShieldBuddy*) and be able to handle error conditions in a well-defined manner.
I've read about setting groups of IO pins in a single operation on an Arduino, and I've already managed this with a ShieldBuddy.
TL;DR:
How do I make a Raspberry Pi HAL work? Where do I start?
I want to configure a basic 4 axis "mill" with spindle control and have the application push bits through a serial port.
I don't care about the voltage levels right now, I just want to watch lines dance around on a scope.
Actually, its more of a "how is the project organized, where things are built and why?"
I've found a "hal_pi_gpio.c" in /src/hal/drivers.
However, the main application makes no attempt to use GPIO pins, whining about the absence of a parallel port.
Stepconf does not produce any signals on the related pins when testing.
What pin numbering scheme is actually used here?
I would like to avoid resurrecting a dinosaur with a parallel port.
I'm trying to figure out where to add support for a custom serial protocol that would satisfy my needs.
So, what did "hal_pi_gpio.c" do? Where did its binary go?
There are no options to use PI GPIO pins, despite the application having been built natively on a Pi 4 (yes, with PREEMPT RT).
The UART is just as fast as any serial port, and any parallel port adapter will be based on shifting bits into registers just to line things up with the parallel port pins. I might as well pipe that into an Arduino (or ShieldBuddy*) and be able to handle error conditions in a well-defined manner.
I've read about setting groups of IO pins in a single operation on an Arduino, and I've already managed this with a ShieldBuddy.
TL;DR:
How do I make a Raspberry Pi HAL work? Where do I start?
I want to configure a basic 4 axis "mill" with spindle control and have the application push bits through a serial port.
I don't care about the voltage levels right now, I just want to watch lines dance around on a scope.
Please Log in to join the conversation.
4 years 5 months ago #244197
by elovalvo
Replied by elovalvo on topic Raspberry Pi
In this link
forum.linuxcnc.org/9-installing-linuxcnc...-io-pins-only#203365
you can find the configuration files (hal and ini) of a minimill using the hal_pi_gpio driver.
Instead at this link you can find the files (hal and xml) of a procedure to drive 2 servos through hal and pyVCP with raspberry pi4 through hap_pi_gpio:
forum.linuxcnc.org/38-general-linuxcnc-q...aspberry-pi-4#222291
forum.linuxcnc.org/9-installing-linuxcnc...-io-pins-only#203365
you can find the configuration files (hal and ini) of a minimill using the hal_pi_gpio driver.
Instead at this link you can find the files (hal and xml) of a procedure to drive 2 servos through hal and pyVCP with raspberry pi4 through hap_pi_gpio:
forum.linuxcnc.org/38-general-linuxcnc-q...aspberry-pi-4#222291
Please Log in to join the conversation.
- differentiable
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
4 years 5 months ago #244200
by differentiable
Replied by differentiable on topic Raspberry Pi
Thanks!
I did see that thread earlier, but I'm basically coming from "I know how to build it from source, but I have no idea why things are organized this way".
Still running into problems with miscellaneous this-and-that not being found or loaded when trying to start the GUI.
It would be nice to have complete "turn-key" examples for the Pi, even if they just blink LEDs really fast (or are only entertaining through a scope).
I did see that thread earlier, but I'm basically coming from "I know how to build it from source, but I have no idea why things are organized this way".
Still running into problems with miscellaneous this-and-that not being found or loaded when trying to start the GUI.
It would be nice to have complete "turn-key" examples for the Pi, even if they just blink LEDs really fast (or are only entertaining through a scope).
Please Log in to join the conversation.
4 years 5 months ago #244211
by elovalvo
Replied by elovalvo on topic Raspberry Pi
A few years ago because of the Covid i have prepared some videos and a pdf tutorial (but in Italian language ..) for my students with some examples of use of the hal_pi_gpio module with devices typically used with Arduino such as LEDs, relays, encoders, DC motors, stepper motors, etc.
In the attachment you will find the sources of the examples.
Create a directory (e.g. halsample) and copy all files.
Then from the terminal you go to the halsample directory and execute the command:
halrun -I -f <filename>.hal
where <filename> is the name of the corresponding hal file.
Try and let me know
In the attachment you will find the sources of the examples.
Attachment not found
Create a directory (e.g. halsample) and copy all files.
Then from the terminal you go to the halsample directory and execute the command:
halrun -I -f <filename>.hal
where <filename> is the name of the corresponding hal file.
Try and let me know
Please Log in to join the conversation.
- differentiable
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
4 years 5 months ago #244270
by differentiable
Replied by differentiable on topic Raspberry Pi
Extremely helpful. Thank you.
So far, I've found stepdir_p.hal and stepdir_v.hal to be useful in eyeballing things.
For others browsing, I should add the GPIO pin tables in hal_pi_gpio.c can be used to determine what physical pins correspond to their HAL symbols.
For example: hal_pi_gpio.pin-19-out actually corresponds to pin # 10 on the GPIO header (of a Pi 4). This can be gleaned from the following snippet in the aforementioned .c file:
So far, I've found stepdir_p.hal and stepdir_v.hal to be useful in eyeballing things.
For others browsing, I should add the GPIO pin tables in hal_pi_gpio.c can be used to determine what physical pins correspond to their HAL symbols.
For example: hal_pi_gpio.pin-19-out actually corresponds to pin # 10 on the GPIO header (of a Pi 4). This can be gleaned from the following snippet in the aforementioned .c file:
Code:
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 };
The driver selects different pin mappings depending on the device. These appear to be correct for the Pi 4.
Please Log in to join the conversation.
4 years 5 months ago #244279
by elovalvo
Replied by elovalvo on topic Raspberry Pi
Please Log in to join the conversation.
- differentiable
- Topic Author
- Offline
- New Member
-
Less
More
- Posts: 4
- Thank you received: 0
4 years 4 months ago #244335
by differentiable
Replied by differentiable on topic Raspberry Pi
German for my car, Italian for the mill project, and a good deal of Spanish where I live
Please Log in to join the conversation.
4 years 4 months ago #244440
by andypugh
Replied by andypugh on topic Raspberry Pi
Just as it hasn't been mentioned, stepconf isn't able to build a config for the Pi. It is only for parallel port systems.
However, it could still make sense to pretend that you have a parallel port, just to create the file structure and skeleton of the config.
However, it could still make sense to pretend that you have a parallel port, just to create the file structure and skeleton of the config.
Please Log in to join the conversation.
Time to create page: 0.098 seconds
