-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dual uart support for tmc2209 #10
Comments
ESPHome enforces the philosophy about UART being a point-to-point interface. Meaning, multiple components can't use the same UART. Control of multiple drivers would have to be worked around directly by the component itself which would break other inherited concepts from the general stepper implementation. It's sadly not feasible at this point nor in the near future. Two TMC2209 drivers require two separate UART connections. What board do you have? Does it use a bidirectional communication with adressing or multiplexing? And if you don't mind, could you share your Arduino sketch? |
Thanks for the fast reply. The guys at ESPHome also were very fast to reply, that's awesome. I first dropped a feature request on the ESPHome github, but they stated it's not a limitation of ESPHome, but the external component. See the request. After that I put the request in at you. The board: [https://easyeda.com/editor#id=373184a84801493a8be75c8b0326f419|eee0760d8de74f0480374f8eba13b889](url) This is the sketch: #include <WiFi.h> const char* ssid = ""; const char* mqtt_server = ""; WiFiClient espClient; #define ACCELERATION_STEPS 300 // Aantal stappen voor acceleratie en vertraging #define RX 16 #define STEP_PIN_BOVEN 14 #define STEP_PIN_ONDER 25 #define EN_PIN 13 TMC2209Stepper driver_boven(&UART2, 0.11f, 0x00); long positie_boven = 0; bool is_moving = false; void setup_wifi() { void reconnect() { void mqtt_callback(char* topic, byte* payload, unsigned int length) { if (String(topic) == "home/cover/plisse/command") { void start_preset(long target_boven, long target_onder) { // Zorg dat boven niet groter is dan onder // Zorg dat onder niet kleiner is dan boven // Stel de richting in voor beide motoren // Bereken het aantal resterende stappen // Start beweging als er stappen nodig zijn void move_steppers() { unsigned long now = micros();
} void setup() { Serial.println("Setting up MQTT..."); reconnect(); Serial.println("Initializing UART..."); driver_boven.begin(); driver_onder.begin(); pinMode(STEP_PIN_BOVEN, OUTPUT); Serial.println("Setup complete!"); void loop() { move_steppers(); |
I have a board where the dual build in tmc2209 drivers share the same uart.
Are you planning on adding support?
That would be much appreciated!
I have it working using Arduino, but ESPHome is a much cleaner solution.
Awesome work you have done!
The text was updated successfully, but these errors were encountered: