Open djamu opened 3 years ago
This idea was also discussed for the ESP32 implementation of Marlin. The ESP32 has simply not enough pins to control everything, so a SPI bus expander (shift register+latch) was proposed...
Are you referring to #11873 ? as I can't find any other issue / feature request related. Aforementioned is not what I mean.
edited: was just looking into the esp32 code, when I realised this is already implemented using I2S... I feel so stupid now.
Hi all, I'd like to have your opinion about following feature/concept.
I was wondering if anybody ever tried an all/only SPI build of Marlin, using (high speed) shift registers/transceivers ( either 8 / 16 bit ). I'm prototyping a control board like that, as it greatly simplifies board layout, daisy chaining SPI shift registers. Common sense dictates to use buffer IC's, before driver IC's, so why not using an SPI bus? Modern devices like the IMXRT1062 (teensy 4) etc... all feature high speed SPI bus(ses). With those speeds, toggling pins on the shift registers can be quicker than those onboard when using DMA. 80Mhz / Mbs can be achieved, theoretically, without the overhead using 8 8 bit registers, (64 pins), this would be 625kHz on all pins. Which is more then fast enough to drive STEP/DIR pins, and even a localized SPI bus.
I've only glanced briefly at the code, but practically, I think the easiest to achieve this is to map the pins to a Union, toggle bits there and transfer its bytes at a fixed frequency using DMA block transfers.
This is actually a similar approach as to PC motherboards that use high speed serial connections instead of parallel. Aside from the simplified board layout, which is modular in design, one could use cpu's with fewer pins yet fast enough to drive lots of motors / mosfets. I think I'd want to keep the analog in though.....
My coding skills are sufficient, as I can understand most code, but I'd like to discuss the best approach before going there. Currently I have assigned 8 bits I/O / motor / other. ( STEP/DIR/ 4 SPI / enable / endstop ), analog inputs are still routed to main CPU ADC's.
good idea ?