Browse Source

Reduce default TMC baudrate to 57600 with Software Serial (#16930)

Jason Smith 4 years ago
parent
commit
2bcc2ec7d1
No account linked to committer's email address
1 changed files with 10 additions and 1 deletions
  1. 10
    1
      Marlin/src/module/stepper/trinamic.cpp

+ 10
- 1
Marlin/src/module/stepper/trinamic.cpp View File

117
 #endif
117
 #endif
118
 
118
 
119
 #ifndef TMC_BAUD_RATE
119
 #ifndef TMC_BAUD_RATE
120
-  #define TMC_BAUD_RATE 115200
120
+  #if HAS_TMC_SW_SERIAL
121
+    // Reduce baud rate for boards not already overriding TMC_BAUD_RATE for software serial.
122
+    // Testing has shown that 115200 is not 100% reliable on AVR platforms, occasionally
123
+    // failing to read status properly. 32-bit platforms typically define an even lower
124
+    // TMC_BAUD_RATE, due to differences in how SoftwareSerial libraries work on different
125
+    // platforms.
126
+    #define TMC_BAUD_RATE 57600
127
+  #else
128
+    #define TMC_BAUD_RATE 115200
129
+  #endif
121
 #endif
130
 #endif
122
 
131
 
123
 #if HAS_DRIVER(TMC2130)
132
 #if HAS_DRIVER(TMC2130)

Loading…
Cancel
Save