Arduino IO Expansion

More
1 year 9 months ago #319223 by Cant do this anymore bye all
Well said. Especially like the comment about python.

Just a note, the 7i90, FPGA (not having a go but there is always some that breaks the rules) can be used as smart serial device. Just digital i/o and 3 mpgs, but the firmware that runs on the softcore can be modded for 4
Mpgs. Tho it was a little frustrating to do at first.

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

More
1 year 9 months ago #319227 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion
Good that you mention Python. A couple weeks ago I learned how to build custom .comp components and I was thinking about moving the communication and logic Part into one.
But I am not sure how much this would improve anything. I guess the Bottleneck is the USB Serial anyway? What do you guys think?

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

More
1 year 9 months ago #319242 by blazini36
Replied by blazini36 on topic Arduino IO Expansion

Good that you mention Python. A couple weeks ago I learned how to build custom .comp components and I was thinking about moving the communication and logic Part into one.
But I am not sure how much this would improve anything. I guess the Bottleneck is the USB Serial anyway? What do you guys think?
 
Yeah, problem there is you can only access a serial port from userspace otherwise it would be good. USB you would probably have to throw out the window, but if someone wrote an actual real-time serial port driver it'd probably be great.

I'll probably fork your repo and push my changes for the I2C IO expanders if you want to take a look at that. Could use some work around the ifdef's for enabling the I2C IO aside from the normal Arduino IO but on my Mega setup it's working great.

Unfortunately I didn't have enough interrupt pins when I made that board and I figured they probably wouldn't be necessary for just knob type encoders but that was a mistake. My MPG uses both interrupts and it works fine, my other encoders work terrible. Now I'm trying to resurrect the board I made for a Teensy 4.1 since they are all interrupt pins. Having a bit of trouble with the I2C on that one for some reason.

Just a note, the 7i90, FPGA (not having a go but there is always some that breaks the rules) can be used as smart serial device. Just digital i/o and 3 mpgs, but the firmware that runs on the softcore can be modded for 4
Mpgs. Tho it was a little frustrating to do at first. 

Yeah, you could use those cards for whatever you want but there's no analog IO on the 7i90/7i92 so you can't really call it a control panel card unless it can do a basic potentiometer reading.

I don't have any pots so I was thinking about using a 7i92 I have laying around. The smart serial cards don't work out well for my case cuz they run off the host card. So I'd be mounting PC inside the control panel  and the ethernet host card in the machine cabinet. So ethernet from the control panel to the machine cabinet and smart serial back to the control panel. That's kind of messy and the control panel can't work standalone.

With a 7i92 I'll just tie up the 2nd ethernet port on my mini-pc, but that's probably not a big deal. I've already used modified 7i92's on custom daughtercards so I already have the PCB footprints and schematic symbols made.....

 

Problem there is there's no I2C module for hm2 that I'm aware of so I'd have to remake my key panel again to use spi IO expanders then BSPI is a bit tough to deal with. I got BSPI almost working for the board in the pic because it has 2 small microcontrollers that communicate with the 7i92, one is actually just for reading analog inputs. I got busy and left that project on the shelf too.

I'll probably just stick with the Arduino-connector setup once I get my Teensy 4.1 version working right for now. The mini-PCs I use have the Intel UARTs so if there's ever a real-time serial port solution I can just migrate over to that.
The following user(s) said Thank You: besriworld

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

More
1 year 9 months ago #319261 by Cant do this anymore bye all
Nice setup old chap, puts my merger efforts at PCB design to shame.

I remember there was a thread about the BSPI thing, tried searching but couldn't find it.

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

More
1 year 9 months ago #319314 by AlexMagToast
Replied by AlexMagToast on topic Arduino IO Expansion

I'll probably fork your repo and push my changes for the I2C IO expanders if you want to take a look at that. Could use some work around the ifdef's for enabling the I2C IO aside from the normal Arduino IO but on my Mega setup it's working great.

I like the I2C IO expansion Idea. I don't have these chips here yet. As I am working on the next Version of Arduino Connector I would implement it in the newer version as it will improve on all the Issues learned from the current version, as it will also get rid of the #defines etc for the user.
Also I forgot to mention that the new Version already supports the connection to multiple Arduinos simultaneously.

If you would like to peek into it you can see it on Github in the dev branch, but keep in mind currently it doesn't work.
Here is a preview of how the new Yaml configuration looks like: github.com/AlexmagToast/LinuxCNC_Arduino...lob/dev/config2.yaml

 

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

More
1 year 9 months ago #319347 by blazini36
Replied by blazini36 on topic Arduino IO Expansion

I like the I2C IO expansion Idea. I don't have these chips here yet. As I am working on the next Version of Arduino Connector I would implement it in the newer version as it will improve on all the Issues learned from the current version, as it will also get rid of the #defines etc for the user.
Also I forgot to mention that the new Version already supports the connection to multiple Arduinos simultaneously.

If you would like to peek into it you can see it on Github in the dev branch, but keep in mind currently it doesn't work.
Here is a preview of how the new Yaml configuration looks like: github.com/AlexmagToast/LinuxCNC_Arduino...lob/dev/config2.yaml


 
Yeah I've seen the v2 but never tried it because it's mentioned in the repo that it doesn't currently work.

I got my Teensy 4.1 break out board working and that handles the encoders much better than the Arduino Mega. The Teensy doesn't have that many IO pins so I have an I2C expander right on the break out board in addition to the 4 expanders on the keypad, I've got that working too.

I'm using MCP23017 expanders on these but I've used PCF857x on other boards, they aren't pin compatible but the libraries are similar.

Right now I'm just looking at how Arduino-connector handles connection states. It seems that even the normal outputs don't reset when LinuxCNC is closed so things that were previously on (like LEDs) stay on. The same happens with the I2C outputs so I suppose it's expected.  Not sure if that's the intended behavior but I've trying to figure out how to reset all outputs (pull low) on disconnect. It's a bit hard to debug since there's only 1 serial connection referenced and it's taken over when LinuxCNC connects, but I have another serial port I can direct debug prints to.

Other than that it all seems to work pretty good, I found a blocking delay in the comalive function that was creating a bit of delay. I replaced that with a timer and it works much better. That plus the tweaks mentioned in the git issues, it's pretty responsive now.

Once I get done putzing around, I'll clean up my code a bit and upload it somewhere.

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

Time to create page: 0.207 seconds
Powered by Kunena Forum