The TMC2300-IOT-REF is a reference design for the TMC2300 stepper motor driver controlled by an ESP32, it also has a CH340 serial to USB chip for programming and debugging the ESP32 via a host PC and a TP4054ST25P for battery charging. The TMC2300 is controlled from the microcontroller via UART on a single pin for TX and RX so a resistor divider (on the left of the diagram) is used to split this signal for the ESP32.
The full schematic for the board is provided on the TMC website. https://www.trinamic.com/support/eval-kits/details/tmc2300-iot-ref/
For my roadtest, I'm going to look at how easy it is to control the motor chip from the ESP32. To give a practical example, I'll be using a USB microscope and the motor will drive the focusing wheel, microswitches connected to the ESP32 will provide limit stops.
Getting to Blink
The first thing needed to get code to compile for the ESP32 SDK is the right board definition. The boards manager for this board can be found on the Espressif github, the documentation tells us to pick the “ESP32 Pico Kit".
The second thing is to know which pin there is an LED on. The design files provide that information, the green status pin is on IO18. The example code on the Trinamic github also references 18 as the value to use.
So that requires some basic modification to the blink sketch.
Example sketch 1
#define LED_STATUS 18 // the setup function runs once when you press reset or power the board void setup() { // initialize digital pin LED_STATUS as an output. pinMode(LED_STATUS, OUTPUT); } // the loop function runs over and over again forever void loop() { digitalWrite(LED_STATUS, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a second digitalWrite(LED_STATUS, LOW); // turn the LED off by making the voltage LOW delay(1000); // wait for a second }
The compiling of the ESP32 code seems to take some time but I uploaded it without issue and had a flashing LED running from both USB power and from the battery. Note that I've used CH340 USB before on this machine so I don't remember if a separate driver needs to be installed. Hopefully one of the other roadtesters will be able to confirm that?
The next thing to try is to have the motor running but my first challenge is that the connectors are not quite right.