Klipper3d / klipper

Klipper is a 3d-printer firmware
GNU General Public License v3.0
9.55k stars 5.33k forks source link

Feature Request - Software SPI #592

Closed GhostlyCrowd closed 6 years ago

GhostlyCrowd commented 6 years ago

Is it possible to get the ability to use software spi rather then hardware on a ramps/mega setup with TMC drivers. This would help many Marlin converts not have to rewire their setup.

KevinOConnor commented 6 years ago

It's certainly possible to implement this. It's not something I plan to work on. All the popular boards use the standard SPI ports and I can't think of any reason a user would want to use non-standard ports.

-Kevin

slipstreamliner commented 6 years ago

One more note; as my previous on the TMC2660 post: You may start seeing a lot more of these as the current and next generation of Duet boards becomes more widespread.

~david@m3d

zerg32 commented 6 years ago

It could be useful for makerbot mightyboard. It uses soft spi to talk to thermocouple via MAX6675 I'm even thinking about implementing it myself but not exactly sure how to organize the code. I have a mks sbase(smoothieboard clone), mightyboard(avr) and ramps for testing/development

KevinOConnor commented 6 years ago

I'm even thinking about implementing it myself but not exactly sure how to organize the code.

It would require mcu code changes. You can look at src/lcd_st7920.c for an example bit banging implementation. I suspect you'd want to hook into src/spicmds.c:spidev_transfer() so that the existing spi commands can be used.

-Kevin

KevinOConnor commented 6 years ago

I'm closing this for now - I'll reopen if someone is actively working on it.

-Kevin

pipersw commented 6 years ago

It usefull on RAMPS too for people with LCD. I use SW SPI with ramps for TMC2130.

LazaroFilm commented 6 years ago

That’s too bad. Virtual SPI would allow to avoid making some crazy soldering son Ramps 1.4 with the LCD extension.

koppersvette1 commented 6 years ago

Man I hope you can add software spi support in the near future. I just ordered a FYSETC F6 control board and 6 tmc2130 drivers with hopes of using it with Klipper.

KevinOConnor commented 6 years ago

As near as I can tell, the FYSETC F6 uses the standard SPI pins, so it's not a problem.

-Kevin

koppersvette1 commented 6 years ago

Thank you for the prompt response @kevinOConnor. I’m currently waiting for the F6 it’s on the slow boat from China.

luxarts commented 6 years ago

The spi pins on Arduino Due aren't in the same physical pin than in Arduino Mega. Only can be accessed by the 6 pin in the middle of the board. I use a MAX6675 connected to the SPI pins of Mega (D52 SCK, D50 MISO) on Ramps 1.4 with Arduino Due. The SD reader doesn't work too for the same problem. When send status I get Max6675 : Device ID error.

KevinOConnor commented 5 years ago

FYI, software spi should now be implemented.

-Kevin

Geramy commented 5 years ago

I can't get software SPI to work on the BIQU SKR v1.3 I keep getting ID Device error for the MAX6675. I do notice the pin i set for the software clk is not pulsing it seems to be just output of a HIGH and not toggling.

I didn't realize at the time the sensor pins for temperature are analog pins and can't be used for anything other than that, probably should note that analog pins cant be used for SPI, ha ha.