As promised..
I Loosly Based my work on the instructions here:
https://toms3d.org/2017/12/09/tmc2130-guide/
I've managed to get the TMC2130 communicating over the SPI bus of GeeeTech 2560 board.
it wasn't really hard but I struggled with the MISO and MOSI pins.
In my logic the OUT pin of the TMC2130 (SDO) should be connected to the IN pin of the atmel2560
That logic proved to be wrong..
I connected SDO to MISO and SDI to MOSI and suddenly no more errors and the printer started moving the X and Y axis.
If you wire it up wrong the firmware halts with a "thermal error" or so. Nothing really breaks but please avoid this as it cannot be healthy.
I used the X_min and X_max pins on the board as well as the Y_min and Y_max
The homing switches are now replaced by the TMC2130 driver software so this is actually no problem.
The settings in the software still need to be tuned as everything moves too rough and quick
(I probably need to figure out the step division jumper settings)
although I thought it was all done by the Marlin software but I may be wrong with that.. (to be continued)
I used a multimeter to beep out the conections from the connector to the ATMEL chip
here's how the connector pins are layed out:
Digital pin 24 => X_max (physical pin 75)
Digital pin 28 => Y_max (physical pin 73)
(these were already in the pins_GT2560_REV_A.h file so it was a good reference for me if the method would work)
SDcard connector layout: (the dots represent the gap in the connector socket on the board)
....
0 1 2 3 4
5 6 7 8 9
0= Physical pin 20 on the atmega (Digital pin 52 or SCK/PCINT1)
1= Physical pin 19 on the atmega (Digital pin 53 or SS/PCINT0)
2= Physical pin 21 on the atmega (Digital pin 51 or MOSI/PCINT2)
3= Physical pin 30 on the atmega (reset!)
4= (5V+? not measured but assumed)
9= GND
8= Physical pin 50 on the atmega (Digital pin 38)
7= Physical pin 52 on the atmega (Digital pin 40)
6= Physical pin 43 on the atmega (Digital pin 21 /SCL int0)
5= Physical pin 22 on the atmega (Digital pin 50 MISO/PCINT3)
How to wire up your TMC2130 driver boards....
Connect SDsocket pin 0 to the SCK pins of all TMC2130 stepper driver boards
Connect SDsocket pin 2 to the SCO pins of all TMC2130 stepper driver boards
Connect SDsocket pin 5 to the SCI pins of all TMC2130 stepper driver boards
It is important not to use the SDcard socket pin 1 as this needs to be empty and cannot be used for other purposes anymore!
Daisy chaining the SPI bus does not work properly if there is a real device connected to the SS pin, so we just fool the chip ;-)
then there are 4 more pins that need to be connected to the X_min and X_max signal pins (to enable communication with the firmware)
The X_min signal pin (pin closest to the edge of the board as the other one is ground) goes to the Diagnostic pin so it can signal the firmware of an exception.
The X_max signal pin (also closest to the edge) goes to the Chip Select CS pin of the TMC2130
Do the same logic for the Y axis stepper driver and boom it all works! (provided you tuned your Marlin firmware a bit ofcourse)
In the pins_GT2560_REV_A.h file of your Marlin firmware
comment out:
//#define X_MAX_PIN 24
//#define Y_MAX_PIN 28
and add:
#define X_CS_PIN 24
#define Y_CS_PIN 28
I think you can figure the rest out yourself right ?
But I'll try to write up a nice word document with some pictures or drawings as I feel this might help a lot of people out.
Not sure when I'll have time for that though.
Cheers and happy tinkering!