SPI pins on the board?

Hi!

I’ve gotten myself some TMC2130 to replace the loud old DRV8825 drivers.
So the new drivers have a SPI bus that can be connected to, and I wonder if the K8400 board have some spar pins that can be assigned to act as a SPI bus for the drivers.

Is that possible?

Hello enduro,

if you have a look on the circuit diagram you can find two interfaces directly served by the CPU: ICSP on the right side and a non commented connection on the left side. I can suggest which connectors are the right one on the motherboard, but I haven’t verified this.

On the ICSP connector you have a full SPI interface except the chip select signal. This must be provided by the other free ports. I have seen, the SPI driver libraries are quite flexible for the usage of the CS pin. However, you have to do some programming in the firmware.

Happy computing

Ah! Thanks for the info!

I think I found them, by probing around with a multimeter

They seem to be connected to the same bus as the CN1 pins

I can probably assign one of the unpopulated pins on the left edge of the picture, they seem to be unused by the board.

Ok follow up question:

How do I reassign the CS pin in the firmware?

I guess I’ll do it in the pins.h file right?
Or pins_RAMPS.h to be precise since I found this code in it:

//
// Steppers
//
#define X_STEP_PIN 54
#define X_DIR_PIN 55
#define X_ENABLE_PIN 38
#define X_CS_PIN 53

#define Y_STEP_PIN 60
#define Y_DIR_PIN 61
#define Y_ENABLE_PIN 56
#define Y_CS_PIN 49

#define Z_STEP_PIN 46
#define Z_DIR_PIN 48
#define Z_ENABLE_PIN 62
#define Z_CS_PIN 40

#define E0_STEP_PIN 26
#define E0_DIR_PIN 28
#define E0_ENABLE_PIN 24
#define E0_CS_PIN 42

#define E1_STEP_PIN 36
#define E1_DIR_PIN 34
#define E1_ENABLE_PIN 30
#define E1_CS_PIN 44

I thinking about the CS_PIN definitions here.
Is that correct?

Dear Enduro,

So you verified the HW SPI interface. The other issue is the Firmware. In the original Vellemann firmware there is no File pins_RAMPS.h. You can define some mnemonics for the free pins on the left connector in Pins.h for the u as CS-Pins. The Vellemann hardware doesn’t know any CS for the stepper driver, so doesn’t the firmware. However, the main challenge is the proper implementation of a driver routine in the firmware.

Hi again.

Forgot to mention that I use Marlin 1.1.8 for this since the original FW dosent support TMC2130 features without heavy modification.

I use it with TMC2130 support disabled at the moment. Since I havet tackled the CS pin part yet.

So if we look at it from the perspective of the new firmware, is this the correct way to do it?

Update:

Found this thread.
https://www.reddit.com/r/3Dprinting/comments/7j59r1/tmc2130_spi_with_ramps_14_and_lcd_display?sort=confidence

Seems like the pins_RAMPS.h is the right one to edit. In Marlin 1.1.8

Keep us informed how you get on. I might revisit using the Trinamic drivers over SPI if you get success :smiley:

If I succeed I will post a guide here on the forums :slight_smile: stay tuned

Dear enduro,

please take care not to mix up different things.

First of all I don’t follow the Marlin updates since they are related only to newer hardware, and the K8400 do not support these new drivers. That’s just one reason why I will not implement this feature in my firmware flavor (at least at the moment).

I haven’t checked Marlin 1.1.8, but with 1.1.6 you can find a lot of configuration files for different printers. If you have a running firmware configuration based on Marlin 1.1.8 I believe that you are using the configuration examples provided for K8400 and the file “pins_K8400.h”. So this would be the proper source to be modified, not the RAMPS file. You may can get some ideas from that, but finally you has to modify the correct, active source!

Happy computing.

Hi hoh61

Thanks for your concern.

I use a config file specific for the k8400 that came with the firmware. That I, step by step customised, and tried after each change.

At the moment I run it with the TMC2130 features turned off for obvious reasons
But the drivers are installed and are running

The reason I chose to edit the pins_RAMPS.h is that it is included in the pins_K8400.h file.

Like this
#include pins_RAMPS.h

And the chip select pin definitions are not present in pins_K8400.h.

So to make things a bit easier I’ll try to edit pins_RAMPS.h since those settings will be implemented.

I will of course be cautious, and take things one step at a time.

Okay, update!

Tested to activate SPI mode in the Z axis driver and it works! :smile:

It’s soo silent and smooth :blush:

And I can even adjust the tepper moter current straight from the PC with G-code commands

1 Like

Okay new update!

PSA dont buy cheapo chinese FYSETC TMC2130, multiple drivers broke on me and gave me lots of headache.
Ordering a bunch from watterott instead :slight_smile:

When I get it all up and running I will post a guide on how to do it