klipper icon indicating copy to clipboard operation
klipper copied to clipboard

Question about TMC2130 in HW SPI mode

Open zentaos opened this issue 8 years ago • 6 comments

Hello guys!

I'm currently merging my printer from Marlin to Klipper and I have a question about the TMC2130 drivers.

I connected 5+3 cables to the board:

  • SDO (shared between all drivers)
  • SDI (also shared)
  • SCK (also shared)
  • X CS
  • Y CS
  • Z CS
  • E0 CS
  • E1 CS (used as Z2)

The problem is that I don't find any pin configuration options in Klipper for the SDO/SDI/SCK pins.

Can you please explain it why? Are these not needed anymore or they have a default value?

Thanks!

zentaos avatar Jul 14 '18 08:07 zentaos

I use an Arduino 2560 + RAMPS 1.4 and the SPI pins are hardwired. I think you can't reassign them.

fbitto avatar Jul 14 '18 11:07 fbitto

Oh okey, I just checked the source code and I see them they use the same pins as Marlin, so they will work the same without rewiring them to another ones.

I just missed this from the documentation.

Thanks :)

zentaos avatar Jul 14 '18 12:07 zentaos

You can reassign them. Check the "examples-extras.cfg" file. Search TMC2130 and a couple sections down from that check the LCD display example on the call out. The LCD shares all the same SPI pins but for each motors cs pin.

CHILLYSMOKES avatar Jul 14 '18 15:07 CHILLYSMOKES

If I'm reading this correctly, you can only set the spi-clock pin on SPI, not the MOSI or MISO. Can you confirm?

Tahutipai avatar Sep 25 '18 20:09 Tahutipai

The MOSI, MISO, and SCK pins are determined by the hardware (and thus can not be changed). The chip select line can be chosen freely.

-Kevin

KevinOConnor avatar Sep 26 '18 13:09 KevinOConnor

Maybe by assigning SPI pins they mean the software SPI - using that you could assign the MOSI, MISO and CLK pins. Although I don't know why would one want to use the slow software SPI where you have the hardware one available.

pkucmus avatar Dec 15 '18 23:12 pkucmus