Proposal for improving documentation
05 Dec 2020 20:17 #191163
by zz912
Proposal for improving documentation was created by zz912
When I started with LinuxCNC, I thought that HAL modules could only be programmed in Python. I don't know Python, so I didn't deal with creating my own HAL component. It was just by chance that I found out that it is possible to create HAL modules in C. C is the Arduino language.
I make a suggestion to improve the documentation.
I think it would be appropriate to extend the article at least to the definition of Userspace and RTspace.
For example, at least some suitable reference.
www.linfo.org/user_space.html
www.linfo.org/kernel_space.html
I make a suggestion to improve the documentation.
I think it would be appropriate to extend the article at least to the definition of Userspace and RTspace.
For example, at least some suitable reference.
www.linfo.org/user_space.html
www.linfo.org/kernel_space.html
Attachments:
Please Log in or Create an account to join the conversation.
15 Dec 2020 09:23 - 22 Dec 2020 13:33 #192037
by zz912
Replied by zz912 on topic Proposal for improving documentation
Here could be added:
linuxcnc.org/docs/2.8/html/examples/spin...l#_pwm_spindle_speed
source:
www.forum.linuxcnc.org/38-general-linuxc...h-mesa-7i92?start=10
linuxcnc.org/docs/2.8/html/examples/spin...l#_pwm_spindle_speed
Source for parport:
.............................
.............................
.............................
Source for MESA:
#PWM Generator signal/setup
setp hm2_7i96.0.pwmgen.pwm_frequency 1500
setp hm2_7i96.0.pwmgen.00.output-type 1
# Set the spindle's top speed in RPM
setp hm2_7i96.0.pwmgen.00.scale 5000
setp hm2_7i96.0.pwmgen.00.enable true
net spindle-speed spindle.0.speed-out-abs => hm2_7i96.0.pwmgen.00.value
source:
www.forum.linuxcnc.org/38-general-linuxc...h-mesa-7i92?start=10
Last edit: 22 Dec 2020 13:33 by zz912. Reason: I had error in code.
Please Log in or Create an account to join the conversation.
- BeagleBrainz
- Offline
- User is blocked
Less
More
- Posts: 1437
- Thank you received: 570
16 Dec 2020 01:09 #192088
by BeagleBrainz
Replied by BeagleBrainz on topic Proposal for improving documentation
For the impatient jump to the end of the post.
For the ramblings of an old man who likes to shout at clouds please continue and I'll tell you about how we used turnips to fix Red Sixes. ( well when there wasn't a lump hammer & cold chisel in reach )
I never had any trouble finding how to create HAL comps in C.I guess I'm just a little more inquisitive, and usually go through all the headings for a particular topic. And to be honest "HAL Component Generator" would be a good heading to read if you were wanting to create your own HAL components.
And to be fair the docs aren't really meant to be a in depth tutorial\reference on Linux programming in general.
And to be perfectly honest Arduino programming is more akin to C++ (a subset of C++) than plain old C. The 2 example below demonstrate this in a very basic way.
Classic Arduino HelloWorld.
HelloWorld from "C Programming With Arduino" By Warwick A Smith
Note that stdio_setup.h & the accompanying stdi_setup.c are supplied by the author.
Whilst the whole Arduino ecosystem has made microcontrollers & electronics more palatable to a larger audience, it also has the consequence of leaving many with a "one tool toolbox". Rather than throw a few logic gates together or (yes this is true) get a multimeter they turn to an Arduino.
I found a lot of the fun with microcontrollers was learning the assembly instructions associated with that particular chip and getting the most that I could out of it. You got a far better understanding from going that route.
And yes "back in the olden days" I did alot of win32 programming in assembly, not just apps but a device driver or 2 for Win 9x. At the time I found it easier than see as I could visualise the data moving around easier.
So after the long winded rambling of an old man, I hope you take 3 things, be a little bit more inquisitive, Arduino programming is a subset of C++ and finally, Arduino can make you a little lazy and not expose you to the whole picture.
For the ramblings of an old man who likes to shout at clouds please continue and I'll tell you about how we used turnips to fix Red Sixes. ( well when there wasn't a lump hammer & cold chisel in reach )
I never had any trouble finding how to create HAL comps in C.I guess I'm just a little more inquisitive, and usually go through all the headings for a particular topic. And to be honest "HAL Component Generator" would be a good heading to read if you were wanting to create your own HAL components.
And to be fair the docs aren't really meant to be a in depth tutorial\reference on Linux programming in general.
And to be perfectly honest Arduino programming is more akin to C++ (a subset of C++) than plain old C. The 2 example below demonstrate this in a very basic way.
Classic Arduino HelloWorld.
void setup() {
// put your setup code here, to run once:
Serial.begin(9600);
Serial.println("Hello World!");
}
void loop() {
// put your main code here, to run repeatedly:
}
HelloWorld from "C Programming With Arduino" By Warwick A Smith
#include <stdio.h>
#include "stdio_setup.h"
int main(void)
{
UartInit();
printf("Hello, world!\r\n");
while(1) {
}
}
Note that stdio_setup.h & the accompanying stdi_setup.c are supplied by the author.
Whilst the whole Arduino ecosystem has made microcontrollers & electronics more palatable to a larger audience, it also has the consequence of leaving many with a "one tool toolbox". Rather than throw a few logic gates together or (yes this is true) get a multimeter they turn to an Arduino.
I found a lot of the fun with microcontrollers was learning the assembly instructions associated with that particular chip and getting the most that I could out of it. You got a far better understanding from going that route.
And yes "back in the olden days" I did alot of win32 programming in assembly, not just apps but a device driver or 2 for Win 9x. At the time I found it easier than see as I could visualise the data moving around easier.
So after the long winded rambling of an old man, I hope you take 3 things, be a little bit more inquisitive, Arduino programming is a subset of C++ and finally, Arduino can make you a little lazy and not expose you to the whole picture.
The following user(s) said Thank You: Mike_Eitel, tommylight
Please Log in or Create an account to join the conversation.
Moderators: HansU
Time to create page: 0.107 seconds