I am trying to set up the nano and a Watterott Trinamic TMC2208
I can get the driver to work but I cannot compile the simple example that comes with the library to work.
I would appreciate some help direction
thanks
the error
Users/russellroberts/Library/Arduino15/packages/arduino/tools/arm-none-eabi-gcc/7-2017q4/bin/arm-none-eabi-g++ -mcpu=cortex-m0plus -mthumb -c -g -Os -w -std=gnu++11 -ffunction-sections -fdata-sections -fno-threadsafe-statics -nostdlib --param max-inline-insns-single=500 -fno-rtti -fno-exceptions -MMD -DF_CPU=48000000L -DARDUINO=10810 -DARDUINO_SAMD_NANO_33_IOT -DARDUINO_ARCH_SAMD -DCRYSTALLESS -D__SAMD21G18A__ -DUSB_VID=0x2341 -DUSB_PID=0x8057 -DUSBCON "-DUSB_MANUFACTURER=\"Arduino LLC\"" "-DUSB_PRODUCT=\"Arduino NANO 33 IoT\"" -I/Users/russellroberts/Library/Arduino15/packages/arduino/tools/CMSIS/4.5.0/CMSIS/Include/ -I/Users/russellroberts/Library/Arduino15/packages/arduino/tools/CMSIS-Atmel/1.2.0/CMSIS/Device/ATMEL/ -I/Users/russellroberts/Library/Arduino15/packages/arduino/hardware/samd/1.8.4/cores/arduino -I/Users/russellroberts/Library/Arduino15/packages/arduino/hardware/samd/1.8.4/variants/nano_33_iot -I/Users/russellroberts/Documents/Arduino/libraries/TMCStepper/src -I/Users/russellroberts/Library/Arduino15/packages/arduino/hardware/samd/1.8.4/libraries/SPI /var/folders/z6/tcyclyq10676672qkq094blm0000gn/T/arduino_build_572909/sketch/tmc.ino.cpp -o /var/folders/z6/tcyclyq10676672qkq094blm0000gn/T/arduino_build_572909/sketch/tmc.ino.cpp.o
tmc:36:44: error: use of deleted function 'TMC2208Stepper::TMC2208Stepper(uint16_t, uint16_t, float)'
TMC2208Stepper driver(SW_RX, SW_TX, R_SENSE); // Software serial
^
In file included from /Users/russellroberts/Desktop/tmc/tmc.ino:7:0:
/Users/russellroberts/Documents/Arduino/libraries/TMCStepper/src/TMCStepper.h:819:4: note: declared here
TMC2208Stepper(uint16_t, uint16_t, float) = delete; // Your platform does not currently support Software Serial
^~~~~~~~~~~~~~
/Users/russellroberts/Desktop/tmc/tmc.ino: In function 'void setup()':
tmc:49:26: error: use of deleted function 'void TMC2208Stepper::beginSerial(uint32_t)'
driver.beginSerial(115200); // SW UART drivers
^
In file included from /Users/russellroberts/Desktop/tmc/tmc.ino:7:0:
/Users/russellroberts/Documents/Arduino/libraries/TMCStepper/src/TMCStepper.h:827:9: note: declared here
void beginSerial(uint32_t) = delete; // Your platform does not currently support Software Serial
^~~~~~~~~~~
Multiple libraries were found for "TMCStepper.h"
Used: /Users/russellroberts/Documents/Arduino/libraries/TMCStepper
Multiple libraries were found for "SPI.h"
Used: /Users/russellroberts/Library/Arduino15/packages/arduino/hardware/samd/1.8.4/libraries/SPI
here is my code
/**
Author Teemu Mäntykallio
Initializes the library and runs the stepper
motor in alternating directions.
*/
#include <TMCStepper.h>
//#define EN_PIN 4 // Enable
#define DIR_PIN 4 // Direction
#define STEP_PIN 5 // Step
//#define CS_PIN 42 // Chip select
//#define SW_MOSI 66 // Software Master Out Slave In (MOSI)
//#define SW_MISO 44 // Software Master In Slave Out (MISO)
//#define SW_SCK 64 // Software Slave Clock (SCK)
#define SW_RX 30 // TMC2208/TMC2224 SoftwareSerial receive pin
#define SW_TX 31 // TMC2208/TMC2224 SoftwareSerial transmit pin
//#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(EN_PIN, OUTPUT);
pinMode(STEP_PIN, OUTPUT);
pinMode(DIR_PIN, OUTPUT);
// digitalWrite(EN_PIN, LOW); // Enable driver in hardware
// 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);
}