tmc2208 stepper motor driver problem

I’ve been building a camera motion control system for a while now and everything has been working great. I used an arduino nano in combination with the drv8834 and programmed a whole manue system wich is diplayed on a 1.8’’ tft. But I wasn’t happy with the noise that my stepper motor made, even while using microstepping so I started searching after a solution. After a while I found out about the tmc stepper drivers and bought the tmc2208. I connected everything like shown on pictures on google, but it didn’t worked. So I tried with a simpler programm to just rotate the motor and it worked!

const int stepPin = 12; 
const int dirPin = 7;

void setup() { 
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);
  digitalWrite(dirPin,HIGH);    
}

void loop() {  
  digitalWrite(stepPin,HIGH); 
  delayMicroseconds(10);
  digitalWrite(stepPin,LOW); 
  delayMicroseconds(800);  
}

Than I added the librarys for the tft display and programmed it to just light up blue, started the programm and the display worked but the motor wasn’t rotating anymore.

#include <Adafruit_GFX.h>
#include <Adafruit_ST7735.h>
#define DB      0x0211
#define W       0xFFFF
#define LB      0x03DF
#define TFT_CS     10
#define TFT_RST    8
#define TFT_DC     9

Adafruit_ST7735 TFTscreen = Adafruit_ST7735(TFT_CS,  TFT_DC, TFT_RST);

const int stepPin = 12; 
const int dirPin = 7;

void setup() { 
  TFTscreen.initR(INITR_BLACKTAB);
  TFTscreen.setRotation(0);
  TFTscreen.fillScreen(DB);  
  pinMode(stepPin,OUTPUT); 
  pinMode(dirPin,OUTPUT);  
  digitalWrite(dirPin,HIGH);   
}

void loop() {  
  digitalWrite(stepPin,HIGH); 
  delayMicroseconds(10);
  digitalWrite(stepPin,LOW); 
  delayMicroseconds(800);  
}

Later I tried to messure the voltage between the step pin and gnd while runing the 2nd programm and while I connected those two pins with a multimeter the motor worked! But I didn’t need to connect those 2 pins while running the first programm. An if I pull out the driver and connect an LED with step and gnd it lights up running the first programm but during the second it doesn’t.

So what am I doing wrong?

Maybe the TFT module uses SPI and pin 12 on an Uno is one of the SPI pins. Try using pin 6 for the STEP pin.

...R

Thanks a lot! That's the solution! :slight_smile:
Is there maybe a way to set pin 12 to act like a normal one, because I've made custom pcbs for this project a while ago so I can't just switch from pin 12 to 6.

VinSei:
Is there maybe a way to set pin 12 to act like a normal one,

Not if it is being used for SPI

...R