ArduinoIO HAL component

More
04 Nov 2022 14:15 #255913 by dinodf
Hello, 
in this days I have hacked the Jeff Epler's Arduino HAL (emergent.unpythonic.net/01198594294) and rewrited all the Python and firmware code to have a new HAL that can read (for now) max 32 digital bits in, 32 analog values in, 32 digital bits out and 32 analog values out.
If someone wanna test it i'll be happy to know his opinion :-)

All the code can be found on my github github.com/DinoMesina/arduinoIO

Thanks
Dino 
The following user(s) said Thank You: tommylight, piflixe, smc.collins, panming

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

More
04 Nov 2022 15:47 #255926 by itsme
Replied by itsme on topic ArduinoIO HAL component
Nice, i will test it later, but may take some time...
Can the output pins also be set by hal pins?
The following user(s) said Thank You: dinodf

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

More
04 Nov 2022 20:51 #255962 by dinodf
Replied by dinodf on topic ArduinoIO HAL component
Yes you can use it for input and output, digital and analogical (Input: 0<=analog-in-xx<= 1023 output: 0<=analog-out-xx<=255)
I think I will add the encoder reads for use it as pendant, but before I have to check the velocity of response...

 
Attachments:
The following user(s) said Thank You: billykid, tommylight, chris@cnc

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

More
04 Nov 2022 21:57 - 04 Nov 2022 22:11 #255971 by HansU
Replied by HansU on topic ArduinoIO HAL component
I achieved this by hacking a little ModBus server on a PIC microcontroller and read the signals with the MB2HAL component.
I am currently thinking of using a STM32 board for that to also connect an encoder...
Last edit: 04 Nov 2022 22:11 by HansU.

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

More
04 Nov 2022 22:06 #255972 by chris@cnc
Replied by chris@cnc on topic ArduinoIO HAL component
Yes, it works. I can write all out pins.
   
Attachments:
The following user(s) said Thank You: dinodf, tommylight

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

More
13 Jan 2023 00:16 #261758 by dinodf
Replied by dinodf on topic ArduinoIO HAL component
Hi, in this months I have develop a bit the code and created a little PCB to use it, it work good, read and write all pins correctly but if i run LinuxCNC with arduino unconnected I receive an error about the /dev/ttyXXX but
raise SystemExit
in except Exception as e: do not kill LinuxCNC...

What is the correct way to force LinuxCNC to stop?

Thanks
Regards
Dino

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

More
14 Jan 2023 10:59 #261917 by HansU
Replied by HansU on topic ArduinoIO HAL component
Do you want LinuxCNC exit by a component?

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

More
14 Jan 2023 15:22 #261949 by dinodf
Replied by dinodf on topic ArduinoIO HAL component
I would like that if the component fails LinuxCNC stop, inform the user and exit because I wanna connect ArduinoIO for drive the changing tool hardware .
How can i do it?

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

More
14 Jan 2023 21:38 #261986 by HansU
Replied by HansU on topic ArduinoIO HAL component
I wouldn't recommend to terminate LinuxCNC in that case. Because that will also kill your notification and it's worst if the program just terminates and you don't know why.

I would connect a pin of your component with some logic to iocontrol.0.emc-enable-in to stop LinuxCNC.
Before that you can create a message with linuxcnc.org/docs/html/man/man9/message.9.html
The following user(s) said Thank You: tommylight

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

More
15 Jan 2023 00:31 #262000 by dinodf
Replied by dinodf on topic ArduinoIO HAL component
Yes I can use a workaround but in the log files I can read the reason of LinuxCNC exit so this is not a problem, I think that for security reason if a module fails the control have to stop.

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

Time to create page: 0.233 seconds
Powered by Kunena Forum