Arduino IO Expansion

More
25 Dec 2024 01:15 #317318 by WarcoVMC
Replied by WarcoVMC on topic Arduino IO Expansion
Have you a HAL file example
I have had this woking using the show hal example in you video

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

More
03 Jan 2025 08:36 #317906 by Ehsan_R
Replied by Ehsan_R on topic Arduino IO Expansion
hello
Thanks for your good work
I had a question
Why don't you use spi communication instead of using serial communication?
In my opinion, more reliable performance can be expected using spi connection

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

  • cornholio
  • cornholio's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
03 Jan 2025 09:01 #317908 by cornholio
Replied by cornholio on topic Arduino IO Expansion
I guess SPI would tie you to an arm platform or trying to bit bang from the host PC.
SPI is not recommended for long distance runs (its only really meant to board comms), even 6 or so inches can be unreliable when approaching MHz speeds. Seen this when experimenting with a Mesa 7c81.

Serial can use differential signals if there is noise, SPI differential signals can play havoc with timing at speeds.

And in reality unless you have a real hardware serial port, the serial comms is USB (at the host PC), doesn't run in realtime......in fact there is no realtime serial driver for Linuxcnc.

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

More
03 Jan 2025 14:40 - 03 Jan 2025 14:48 #317930 by Ehsan_R
Replied by Ehsan_R on topic Arduino IO Expansion
It is possible to solve the problem related to distance and speed by using a spi to lan converter similar to the module below
And it had a real time component
www.amazon.com/HiLetgo-Ethernet-Network-...Z820io/dp/B08KXM8TKJ
Attachments:
Last edit: 03 Jan 2025 14:48 by Ehsan_R.

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

  • cornholio
  • cornholio's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
03 Jan 2025 16:29 #317943 by cornholio
Replied by cornholio on topic Arduino IO Expansion
No it’s not a SPI to Ethernet converter.
It’s a chip that has an SPI interface and implements a, for lack of a better description, a network stack.
A micro controller connected to it still has to setup network related things, monitor it for received data and other such tasks.
So no it does nothing to increase the distance between SPI devices.
I suggest you go to the wiznet site and learn what that device actually does. From memory they use the 5500 device.

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

  • cornholio
  • cornholio's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
03 Jan 2025 17:30 #317949 by cornholio
Replied by cornholio on topic Arduino IO Expansion
Oh yeah, it’s a slave device, it doesn’t act as a master.

I doubt a higher rate interface would be a great advantage for a control panel.
I would assume the driver code would called within the context of the servo thread, about 1ms, to denounce a switch would require a couple of ms.
If you need a high speed reliable device to communicate with a control a Mesa card using a smart serial daughter card would be the go, operates at 2.5M bits per second over a Cat5 cable using differential signals and 5v can be sent down the cable as well.
The following user(s) said Thank You: tommylight

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
03 Jan 2025 21:03 #317964 by tommylight
Replied by tommylight on topic Arduino IO Expansion
From some website on google search
The Baud rate refers to the total number of signal units transmitted in one second. The Bit rate refers to the total Bits transmitted in one unit time. Baud rate indicates the total number of times the overall state of a given signal changes/ alters.
and from Mesa manuals
In the operate mode, the baud
rate is set to 2.5M baud (default).
Not the same thing, but close enough.

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

  • blazini36
  • Away
  • Platinum Member
  • Platinum Member
More
03 Jan 2025 22:46 #317977 by blazini36
Replied by blazini36 on topic Arduino IO Expansion

I guess SPI would tie you to an arm platform or trying to bit bang from the host PC.
SPI is not recommended for long distance runs (its only really meant to board comms), even 6 or so inches can be unreliable when approaching MHz speeds. Seen this when experimenting with a Mesa 7c81.

Serial can use differential signals if there is noise, SPI differential signals can play havoc with timing at speeds.

And in reality unless you have a real hardware serial port, the serial comms is USB (at the host PC), doesn't run in realtime......in fact there is no realtime serial driver for Linuxcnc.
 

I actually mentioned this before as you would think as much legacy is built into LinucCNC someone would have worked on an RT serial component. I know Andy replied something along the lines of "I was wondering the same thing" but didn't offer much insight.

Alot of miniPCs expose Intel UART on GPIO headers. I've gotten it to run at reasonably high baud rates but I've only actually used it at standard baud rates. You're pretty much on point about SPI though I2C does get used in alot of cabled applications, Every HDMI cable has I2C in it. It's pretty easy to convert UART to RS422 with just a transceiver IC so that's not a big deal, not sure if using UART for this has any real benefits being there is no RT component but that's one of the things I was hoping to try out as I'd think it'd be just as easy to setup with Arduino-Connector.

I pretty much dropped what I was doing with Arduino-Connector because the lag on the Python side was intolerable. I just looked at the git issues and somebody figured out that it was just due to some serial timeout settings so I'll probably start messing with it again. One problem is I wasn't thrilled about the way the matrix keyboard setup worked and I would up redesigning my key panel to use I2C IO expanders to use with something else that didn't get finished. Now I'm just hoping someone can get support for I2C IO into Arduino Connector so I can try that. I don't think it would be difficult, but I don't do much code myself.
 

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

  • cornholio
  • cornholio's Avatar
  • Away
  • Platinum Member
  • Platinum Member
More
03 Jan 2025 23:30 #317981 by cornholio
Replied by cornholio on topic Arduino IO Expansion
Actually tommy if you look at a serial transmission waveform the signal doesn’t change for every bit sent. If you send 0x00 or 0xFF you’ll see what l mean. Send a string of either value and it will kind of blow google’s answer out of the water.
By google’s definition baud rate will change depending on the data sent.

And if you read carefully the definition you copied and pasted baud rate is defined twice with different definitions.

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

  • tommylight
  • tommylight's Avatar
  • Away
  • Moderator
  • Moderator
More
03 Jan 2025 23:40 #317983 by tommylight
Replied by tommylight on topic Arduino IO Expansion
Yeah a bit explained like i usually do :)
But still valid in both cases, baud rate is the rate of pulses/changes regardless of protocol, bit rate is what changes depending on data/protocol type and the control bits used.

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

Time to create page: 0.095 seconds
Powered by Kunena Forum