GT2560 SPI pins for TMC2130

OctavioMaia
Posts: 0
Joined: Sat Jan 20, 2018 8:29 am

GT2560 SPI pins for TMC2130

Post by OctavioMaia » Sat Jan 20, 2018 8:34 am

Can anyone help me find the SPI pins needed to use the TMC2130 drivers?

This board is poorly documented and I can't find the aux pins needed for the SPI communication with the TMC2130 drivers.

On Thomas video he uses a RAMPS 1.4, and since this is a RAMPS based board it should have those pins.

Video:https://www.youtube.com/watch?v=sPvTB3irCxQ
Image: https://i.imgur.com/Fnw4Rw3.png

User avatar
William
Site Admin
Posts: 6340
Joined: Tue Jun 07, 2016 9:38 am

Re: GT2560 SPI pins for TMC2130

Post by William » Sat Jan 20, 2018 1:40 pm

I suggest you use the TMC2100 because it is quiet and its pin definition is clear
-Keep your mind and try to test it. :)
-Everything will be fun!-Support all Getech printer.
-You can ask me the questions and I will kindly reply.
-Respect others is the best way you can get help!

OctavioMaia
Posts: 0
Joined: Sat Jan 20, 2018 8:29 am

Re: GT2560 SPI pins for TMC2130

Post by OctavioMaia » Sat Jan 20, 2018 6:24 pm

I already have TMC2100 but I have a chinese version and I cannot enable spreadcycle, so it misses steps.-

I've direct soldered the shunt to make it work, etc. Nothing does the trick

User avatar
William
Site Admin
Posts: 6340
Joined: Tue Jun 07, 2016 9:38 am

Re: GT2560 SPI pins for TMC2130

Post by William » Mon Jan 22, 2018 4:29 pm

Here is important info
A4988's main working pin
En: Enable
Dir: Direction
step: pulse
-Keep your mind and try to test it. :)
-Everything will be fun!-Support all Getech printer.
-You can ask me the questions and I will kindly reply.
-Respect others is the best way you can get help!

Yellowtick
Posts: 0
Joined: Fri Jan 26, 2018 3:22 pm

Re: GT2560 SPI pins for TMC2130

Post by Yellowtick » Fri Jan 26, 2018 3:49 pm

Hi both,

I'm trying to figure out the same.
only for the X and Y axis first as we need to sacrifice a lot of pins on the GT2560 board (there are not so many free and they already serve a purpose)

My plan is to sacrifice the SDcard because there are several other options: octopi or directly connected to a pc

this will free up the SPI pins. necessary to communicate with the TMC2130 stepper drivers
Now the pin layout of the SDcard connector needs to be figured out what pin is connected to what arduino pin number.

Once I have that clear the wiring can be setup, Marlin can then be told via the
boardsGT2560.h file
which function lives where.
The current pin info there is a bit cryptic as there is hardly any comments in the file unfortunately

My hope is that the CS_X and CS_Y pins can live on that same connector so I don't need to sacrifice even more functions.
but the X max and Y max ports are still free (and with the TMC2130 the drivers take over that role anyway)

this way at least we'll have a silent running printer. (with software endstops and other more advanced features)

I hope to get more clarity over the weekend
but anyone knowing a pin layout and arduino pin number correspondance of the GT2560 board would be of great help !

THANKS

Yellowtick
Posts: 0
Joined: Fri Jan 26, 2018 3:22 pm

Re: GT2560 SPI pins for TMC2130

Post by Yellowtick » Sat Jan 27, 2018 11:26 pm

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!

ababilone
Posts: 0
Joined: Mon Jan 08, 2018 6:22 am

Re: GT2560 SPI pins for TMC2130

Post by ababilone » Fri Feb 23, 2018 10:42 pm

Hi Yallowtick,

Nice work on getting TMC2130 working with GT2560.

I've ordered some TMC2130 to upgrade my printer as well but I have to confess that everything does not look cristal clear to me right now. on how to wire everything.

Any chance you had the time for that nice word document filled up with pictures ?

Thanks in advance!

VectorRoll
Posts: 0
Joined: Sun Mar 04, 2018 8:07 am

Re: GT2560 SPI pins for TMC2130

Post by VectorRoll » Sun Mar 04, 2018 11:34 am

I to would like to see a PIC of everything wired up as I have a few questions. I would like to see if I wired it up right. :)

The original guide by Thomas Sanladerer is a bit confusing as it leaves out a few details and also some of what is said here overlooks a few details. In part what to do with the CS for the Z and E0 steppers as well as the diagnostic pin for them. In Thomas's guide he shows what to do with all the CS and most of the Diagnostics for the Ramps but does not mention what to do with the Diagnostics pin for E0 at all. That sort of makes me think we do not use the E0 Disagnostic at all. His diagram has it marked on the pic but shows no line from it to a pin as if it does not get hooked up.
Here in this thread the Diagnostics and CS for Z and E0 are skipped entirely.

So...

For the CS of Z and E0, which pins do we connect them to on the GT2560?

In the Thomas's guide Z's CS goes to the D40 pin of AUX-2. In the Schematic for the GT2560, if I am reading it right, 40 is the PL5. Not sure what pin that is on the GT2560. (But in reading what Yellowtick says above, I think this is Pin 52 which is the PG1 for GT2560.) Is that correct?

In the Thomas's guide E0's CS goes to the D42 pin of AUX=2. In the Schematic for the GT2560 the 42 is the PL7. That pin is actually right next to the MISO in the SD card's (SV3). So should the E0's CS go to the PL7 which is right next to the MISO in the SD? But in wondering that I see a few post up Yellowtick list it as Pin 43 which is the E0_STEP_PIN in (pins_GT2560_REV_A.h). So I am a bit confused by that. Are we supposed to hookup the E0 CS to that pin or some other pin?

For the Diagnostics are we supposed to just skip hooking them up for the Z and E0 steppers? In the Thomas's Guide it has the Z Diagnostic going to the Z endstop but I think that since I us a Inductive Sensor I don't need that or at least can't use that as I hook the sensor into it. There is nothing for E0 Diagnostic as all in Thomas's guide. So I am not sure what to do for this part.



I think if I could see a pic of a GT2560 and how the TMC2130's are all connected would help a lot.
Another thing that would be nice is a good schematic showing the GT2560 board itself with the actual Pin Layout. The Ramps 1.4 has that and it makes identifying the Pins. It is a lot easier than what we have with the (GT2560_sch.pdf).

afkool
Posts: 0
Joined: Sat Mar 31, 2018 8:32 am

Re: GT2560 SPI pins for TMC2130

Post by afkool » Sat Mar 31, 2018 8:42 am

[quote=Yellowtick post_id=82299 time=1517066789 user_id=63577]

I connected SDO to MISO and SDI to MOSI and suddenly no more errors and the printer started moving the X and Y axis.
...
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
...
[/quote]

Your "Connect SDsocket..." sections have the SPI pins backward even though you mention the correct ones above. Spent quite some time trying to figure out what was wrong and ended up breaking out my logic analyzer to figure out they were backward.

Should be:
Connect SDsocket pin 0 to the SCK pins of all TMC2130 stepper driver boards
Connect SDsocket pin 5 to the SCO pins of all TMC2130 stepper driver boards
Connect SDsocket pin 2 to the SCI pins of all TMC2130 stepper driver boards

I attached a picture of the x-axis wiring for extra reference.
Attachments
20180329_225610.jpg
20180329_225610.jpg (386.55 KiB) Viewed 26964 times

Hedobum
Posts: 1
Joined: Wed Mar 08, 2017 12:02 pm

Re: GT2560 SPI pins for TMC2130

Post by Hedobum » Thu Apr 12, 2018 1:00 pm

This is awesome!
I just got my 2130s last week (originally intended for the upcoming smoothie build) and got a little impatient waiting, so they're going on my GT2560.
I'm ok with losing the SD. I have Octoprint. Not sure if I got something right though...
You initially said you were using the X&Y_max endstops but the pic appears to be using the x_min&max. Did I miss something somewhere? Is it pins 75&73?
Preparing my drivers now. Exciting shit!

Post Reply