scottbez1 / splitflap

DIY split-flap display
https://scottbez1.github.io/splitflap
Other
3.15k stars 259 forks source link

Ethernet shield compatibility #51

Closed henricazottes closed 4 years ago

henricazottes commented 5 years ago

I'd like to have the screen connected to ethernet so I can control it from the network. From what I see, it uses the spi bus from the ICSP connector. This prevent my ethernet shield from being compatible because it also need those SPI lines (I'm using a clone of this board: http://shieldlist.org/arduino/ethernet-v5). From what I read it could be possible to have it working by using SS pins (I have no experience with SPI bus). I'll try to work it out but if you have any tips for it feel free to share ;)

henricazottes commented 5 years ago

Ok so I'm definitely not comfortable enough with SPI and your project to choose which direction to take... But here are the two options I found:

Do you know if any of these options could be possible ? And if yes, which one do you think is the easiest to implement ?

scottbez1 commented 5 years ago

Hmmm, this may be tricky to get working. You're right that the control board uses hardware SPI over the ICSP connector. The current control board design also doesn't have any slave-select functionality; it expects to be the exclusive device on the SPI bus.

I suspect it won't work to use software spi to drive the splitflap control board (I had to do quite a bit of optimization to get the code running fast enough to drive the motors successfully even with hardware spi). With the internal gearing, the motors have 2048 steps per revolution which means you need to send pulses to them really quickly to get them to spin fast, which means not only does the SPI need to be fast, the Arduino also can't really do any additional processing during movement (e.g. right now the sketch ignores serial input except when all modules are idle; otherwise the extra processing of serial input can mess with the precise timing and cause the motors to miss steps)

So the only other option I can think of would be to see if there's a way to wire up the ethernet shield to different pins and use software spi for that, though I'm not sure the Ethernet library would support that out of the box...

henricazottes commented 5 years ago

Ok, that's what I thought. Thanks for the detailed explanation! As a solution I ended up using a second Arduino with the shield and made the two of them communicate over UART. Working great, but it's not the best form factor :p

scottbez1 commented 5 years ago

Ah yeah, that's a great solution! Glad to hear it's working, even if it's not the prettiest thing :)

I'm going to leave this open but assign it low priority, as it seems like a valid concern on a somewhat rare combination (anecdotally I've heard a lot more interest in ESP8266-based wifi integration, so I'm leaning toward focusing on that as far as network integration is concerned).

scottbez1 commented 4 years ago

Closing this for now - no current plans to support Ethernet shields (though pull requests are always welcome!)