Help me remember? Recompile firmware with TMC5160 drivers

Hello, all. My LR2 has been put out to pasture after cutting parts for its replacement. I have the LR3 all set up and wired, but it’s been so long since I built the LR2, that I’ve forgotten how I changed that firmware to use the motor drivers I have.

I recalled that I have PlatformIO, and I downloaded and opened it in PlatformIO. Here’s where I am now:

Do I just copy/paste TMC5160 for every instance of TMC2209 that I see in Configuration.h and then compile? Or are there other changes that I need to make elsewhere?

EDIT: I guess to be clear I should mention that I’m using a BigTreeTech SKR 1.3 with the above mentioned drivers. It is the same card I was using in my LR2, which was working as of yesterday, so no changes to the board itself. I did, however, download new firmware, because I figured the LR3 would home differently than my LR2 (which homed Z down and Y at what is now considered the rear of the table).

After some painful futzing with PlatformIO, I was able to compile firmware with TMC5160 substituted for TMC2209. With that flashed, I got a “Testing X connection… Error all high” message, but no stepper motor movement. I read some more here and found that someone suggested uncommenting TMC_USE_SW_SPI in Configuration_adv.h, so I did that but got exactly the same results. So I have that error and no movement from any stepper motor.

I guess a related question (and probably a stupid one) is, do I have to change the firmware for my LCD touchscreen? I have a MakerSpace TFT28, but the only touchscreen firmware I see mentioned here is for a TFT35, and I don’t know if that would work. Either way, it seems that there is some communication between Marlin, the board and the LCD, as I can at least see that error message.

I’m having flashbacks to the struggle two years ago, and would appreciate any guidance!

Turns out 2020 me had the foresight to save the working firmware. I tried that and noticed a couple of things. First, a green LED lit up on the board when I flashed it. This didn’t happen with the new firmware, though most of the time the filename on the SD card did change to *.cur. Second, I now have motor movement, though the homing commands move the motors in the opposite direction of what the LR3 needs. I guess I’ll look for ways to modify that?

Second, I now have motor movement, though the homing commands move the motors in the opposite direction of what the LR3 needs.

I’m not a LowRider owner, so there might be more to this issue, but typically if stepper motors are moving in the wrong direction, you simply need to flip a plug to reverse the direction of a motor. So, if you have a pair of motors moving in the wrong direction, you can flip both plugs at the control board.

The simplest way to fix that is to change the motor connections on the board. Rotate them 180° so that instead of 1234 it’s 4321. This reverses the stepper rotation. (Same as what Robert was saying, I guess.)

True! Thanks, guys. Maybe once I get it running right I’ll try comparing the source for the two firmware versions to see what I was doing wrong.