Ok got some updates. Regarding DEV board specifications UART1 should be on pins 17 and 18 but I have purchased a Logic analyzer and found out that my RX and TX pins are 16 and 15 pins. Hardware serial library decided to change those pins regarding my MP type...
So when I changed pins UART communication started to work. Also, please keep in mind - UART communication will work only if you will power VMM (like @monkeyfist mentioned).
Unfortunately, I have encountered another problem
The motor does not rotate - only vibrates
Maybe something is wrong with RMS, Microstepp settings, A/B connections, or something else...
Here is my test code, maybe you could spot my mistake...
/**
* Author Teemu Mäntykallio
* Initializes the library and runs the stepper
* motor in alternating directions.
*/
#include <Arduino.h>
#include <TMCStepper.h>
#define DIR_PIN 38 // Direction
#define STEP_PIN 39 // Step
#define SERIAL_PORT Serial1 // TMC2208/TMC2224 HardwareSerial port
#define DRIVER_ADDRESS 0b00 // TMC2209 Driver address according to MS1 and MS2
#define R_SENSE 0.11f // Match to your driver
// SilentStepStick series use 0.11
// UltiMachine Einsy and Archim2 boards use 0.2
// Panucatt BSD2660 uses 0.1
// Watterott TMC5160 uses 0.075
// Select your stepper driver type
// TMC2130Stepper driver(CS_PIN, R_SENSE); // Hardware SPI
// TMC2130Stepper driver(CS_PIN, R_SENSE, SW_MOSI, SW_MISO, SW_SCK); // Software SPI
// TMC2660Stepper driver(CS_PIN, R_SENSE); // Hardware SPI
// TMC2660Stepper driver(CS_PIN, R_SENSE, SW_MOSI, SW_MISO, SW_SCK);
// TMC5160Stepper driver(CS_PIN, R_SENSE);
// TMC5160Stepper driver(CS_PIN, R_SENSE, SW_MOSI, SW_MISO, SW_SCK);
TMC2208Stepper driver(&SERIAL_PORT, R_SENSE); // Hardware Serial
// TMC2208Stepper driver(SW_RX, SW_TX, R_SENSE); // Software serial
// TMC2209Stepper driver(&SERIAL_PORT, R_SENSE, DRIVER_ADDRESS);
// TMC2209Stepper driver(SW_RX, SW_TX, R_SENSE, DRIVER_ADDRESS);
void setup()
{
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
// Enable one according to your setup
// SPI.begin(); // SPI drivers
SERIAL_PORT.begin(115200); // HW UART drivers
// driver.beginSerial(115200); // SW UART drivers
driver.begin(); // SPI: Init CS pins and possible SW SPI pins
// UART: Init SW UART (if selected) with default 115200 baudrate
driver.toff(5); // Enables driver in software
driver.rms_current(600); // Set motor RMS current
driver.microsteps(16); // Set microsteps to 1/16th
// driver.en_pwm_mode(true); // Toggle stealthChop on TMC2130/2160/5130/5160
driver.en_spreadCycle(false); // Toggle spreadCycle on TMC2208/2209/2224
driver.pwm_autoscale(true); // Needed for stealthChop
}
bool shaft = false;
void loop()
{
// Run 5000 steps and switch direction in software
for (uint16_t i = 5000; i > 0; i--)
{
digitalWrite(STEP_PIN, HIGH);
delayMicroseconds(160);
digitalWrite(STEP_PIN, LOW);
delayMicroseconds(160);
}
shaft = !shaft;
driver.shaft(shaft);
}
Never the less I will try to investigate my issues and I will update you on my progress.